Skip to content

Commit 47b5aef

Browse files
authored
Orca cleanup (#767)
* whatsnew * remove orca test fixtures, notes, cli command
1 parent 1b99ad2 commit 47b5aef

File tree

6 files changed

+26
-30
lines changed

6 files changed

+26
-30
lines changed

docs/source/whatsnew/1.0.11.rst

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
.. _whatsnew_1011:
2+
3+
.. py:currentmodule:: solarforecastarbiter
4+
5+
6+
1.0.11 (December 13, 2021)
7+
--------------------------
8+
9+
Enhancements
10+
~~~~~~~~~~~~
11+
* Updated Plotly version to 4.9 which uses Kaleido for pdf plot
12+
rendering. Use of Kaleido removes the need for starting an Orca
13+
server when generating reports and is available as a pip installable
14+
package with no other dependencies. This update also improves
15+
performance and reliability of the report computation process.
16+
(:pull:`765`)
17+
18+
Contributors
19+
~~~~~~~~~~~~
20+
21+
* Will Holmgren (:ghuser:`wholmgren`)
22+
* Leland Boeman (:ghuser:`lboeman`)

docs/source/whatsnew/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ These are new features and improvements of note in each release.
99
.. toctree::
1010
:maxdepth: 2
1111

12+
1.0.11
1213
1.0.10
1314
1.0.9
1415
1.0.8

solarforecastarbiter/cli.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -445,17 +445,12 @@ def referencenwp(verbose, user, password, base_url, run_time,
445445
'--serialization-roundtrip', is_flag=True,
446446
help='Run the raw report through a mock API with serialization'
447447
)
448-
@click.option(
449-
'--orca-server-url', help=(
450-
'URL to the plotly orca server to generate PDF images if '
451-
'orca is not installed locally')
452-
)
453448
@click.argument(
454449
'report-file', type=click.Path(exists=True, resolve_path=True))
455450
@click.argument(
456451
'output-file', type=click.Path(resolve_path=True))
457452
def report(verbose, user, password, base_url, report_file, output_file,
458-
format, serialization_roundtrip, orca_server_url):
453+
format, serialization_roundtrip):
459454
"""
460455
Make a report. See API documentation's POST reports section for
461456
REPORT_FILE requirements.
@@ -468,9 +463,6 @@ def report(verbose, user, password, base_url, report_file, output_file,
468463
metadata = json.load(f)
469464
session = APISession(token, base_url=base_url)
470465
report = session.process_report_dict(metadata)
471-
if orca_server_url is not None:
472-
import plotly.io as pio
473-
pio.orca.config.server_url = orca_server_url
474466
if serialization_roundtrip:
475467
with mock_raw_report_endpoints(base_url):
476468
session.create_report(report)

solarforecastarbiter/conftest.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3843,13 +3843,6 @@ def raw_report_dict_with_prob(fail_pdf):
38433843
}
38443844

38453845

3846-
@pytest.fixture(scope='function')
3847-
def remove_orca():
3848-
# otherwise generating all pdfs for tests can take ages
3849-
import plotly.io as pio
3850-
pio.orca.config.executable = '/dev/null'
3851-
3852-
38533846
@pytest.fixture()
38543847
def constant_cost():
38553848
return datamodel.ConstantCost(

solarforecastarbiter/reports/figures/plotly_figures.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1120,12 +1120,6 @@ def output_svg(fig):
11201120
Returns
11211121
-------
11221122
svg : str
1123-
1124-
Notes
1125-
-----
1126-
Requires `Orca <https://plot.ly/python/orca-management/>`_ for generating
1127-
svgs. If orca is not installed, an svg with an error message will be
1128-
returned.
11291123
"""
11301124
try:
11311125
svg = fig.to_image(format='svg').decode('utf-8')
@@ -1157,12 +1151,6 @@ def output_pdf(fig):
11571151
-------
11581152
pdf : str
11591153
An ASCII-85 encoded PDF
1160-
1161-
Notes
1162-
-----
1163-
Requires `Orca <https://plot.ly/python/orca-management/>`_ for generating
1164-
pdfs. If orca is not installed, an pdf with an error message will be
1165-
returned.
11661154
"""
11671155
# If height is explicitly set on the plot, remove it before generating
11681156
# a pdf. Needs to be reset at the end of the function.

solarforecastarbiter/reports/tests/test_reports_main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020

2121
@pytest.fixture()
22-
def _test_data(report_objects, ref_forecast_id, remove_orca):
22+
def _test_data(report_objects, ref_forecast_id):
2323
report, observation, forecast_0, forecast_1, aggregate, forecast_agg = \
2424
report_objects
2525
base = Path(__file__).resolve().parent
@@ -82,7 +82,7 @@ def test_get_data_for_report(mock_data, report_objects, mocker):
8282

8383

8484
@pytest.fixture()
85-
def _test_event_data(event_report_objects, remove_orca):
85+
def _test_event_data(event_report_objects):
8686
report, observation, forecast_0, forecast_1 = event_report_objects
8787

8888
tz = "US/Pacific"

0 commit comments

Comments
 (0)