Skip to content

Commit

Permalink
#6022 - import numpy in resizing fns
Browse files Browse the repository at this point in the history
  • Loading branch information
mkeilman committed Jul 31, 2023
1 parent 0e3add6 commit 5e44915
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions sirepo/package_data/template/srw/parameters.py.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,7 @@ _CANVAS_MAX_SIZE = {{ canvasMaxSize }}
_JSON_MESSAGE_EXPANSION = {{ jsonExpandFactor }}
_MAX_MESSAGE_BYTES = {{ maxMsgBytes }}


{{ extendPlot }}


Expand All @@ -501,6 +502,7 @@ _MAX_MESSAGE_BYTES = {{ maxMsgBytes }}

{{ updateReportRange }}


def main():
{{srwMain}}
epilogue()
4 changes: 4 additions & 0 deletions sirepo/template/srw.py
Original file line number Diff line number Diff line change
Expand Up @@ -1528,6 +1528,8 @@ def _export_rsopt_config(data, run_dir):
def _extend_plot(
ar2d, x_range, y_range, horizontalStart, horizontalEnd, verticalStart, verticalEnd
):
import numpy as np

x_step = (x_range[1] - x_range[0]) / x_range[2]
y_step = (y_range[1] - y_range[0]) / y_range[2]

Expand Down Expand Up @@ -2544,6 +2546,8 @@ def _template_text(text):


def _update_report_range(report, ar2d, x_range, y_range):
import numpy as np

horizontalStart = (report.horizontalOffset - report.horizontalSize / 2) * 1e-3
horizontalEnd = (report.horizontalOffset + report.horizontalSize / 2) * 1e-3
verticalStart = (report.verticalOffset - report.verticalSize / 2) * 1e-3
Expand Down

0 comments on commit 5e44915

Please sign in to comment.