restage 0.6.0__py3-none-any.whl → 0.7.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
restage/run.py CHANGED
@@ -5,7 +5,7 @@ from .range import Singular
5
5
 
6
6
  def make_run_parser():
7
7
  from argparse import ArgumentParser
8
- parser = ArgumentParser('mcbifrost_run')
8
+ parser = ArgumentParser('restage')
9
9
  parser.add_argument('primary', nargs=1, type=str, default=None,
10
10
  help='Primary spectrometer `.instr` file name')
11
11
  parser.add_argument('secondary', nargs=1, type=str, default=None,
restage/tables.py CHANGED
@@ -65,7 +65,7 @@ class SimulationEntry:
65
65
  self.precision[k] = abs(self.precision[best[0]])
66
66
  elif self.parameter_values[k].has_value:
67
67
  # This abs is *crucial* since a negative parameter value would have a negative precision otherwise
68
- self.precision[k] = abs(self.parameter_values[k].value / 100)
68
+ self.precision[k] = abs(self.parameter_values[k].value / 10000)
69
69
  else:
70
70
  log.info(f'SimulationEntry.__post_init__:: No precision match for value-less {k}, using 0.1;'
71
71
  ' consider specifying precision dict during initialization')
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: restage
3
- Version: 0.6.0
3
+ Version: 0.7.0
4
4
  Author-email: Gregory Tucker <gregory.tucker@ess.eu>
5
5
  License: BSD-3-Clause
6
6
  Classifier: License :: OSI Approved :: BSD License
@@ -17,7 +17,7 @@ Requires-Dist: zenlog>=1.1
17
17
  Requires-Dist: platformdirs>=3.11
18
18
  Requires-Dist: confuse
19
19
  Requires-Dist: psutil>=5.9.6
20
- Requires-Dist: mccode-antlr[hdf5]>=0.13.0
20
+ Requires-Dist: mccode-antlr[hdf5]>=0.14.0
21
21
  Provides-Extra: test
22
22
  Requires-Dist: pytest; extra == "test"
23
23
  Requires-Dist: chopcal; extra == "test"
@@ -54,21 +54,21 @@ pip install git+https://github.com/g5t/restage.git
54
54
  ```
55
55
 
56
56
  ## Usage
57
- ### `restage`
58
- The `restage` module provides a function, `restage`, which takes a McStas instrument file as input.
59
- The function will then parse the instrument file and generate new instrument files for the first and second stage simulations.
60
- The new instrument files will be named `restaged_lower_<original instrument file name>.instr`,
61
- and `restaged_upper_<original instrument file name>.instr`, respectively.
62
57
 
63
58
  ### `splitrun`
64
- A more useful function, `splitrun`, is also provided by the `restage` module.
65
- The `splitrun` function takes the same arguments as the `restage` function,
66
- but will also run the simulations for the first and second stage.
67
- The function will return the output of the second stage simulation.
68
-
69
- The `splitrun` function can be used as a replacement for the `mcrun` function distributed as part of McStas.
70
- One optional argument, `splitpoint`, is added to the `splitrun` function; it should be the name of
71
- an `Arm` component inside the instrument file and defaults to `split_at`.
59
+ The `restage` module provides a command line program, `splitrun`, which
60
+ can be used as a replacement for the `mcrun` function distributed as part of McStas.
61
+
62
+ `splitrun` produces two instrument stages, before and after a split point, and runs
63
+ the specified parameter set(s) in both stages connecting the two through cached MCPL
64
+ state files.
65
+ The first stage results are stored in a user cache directory and the second stage output
66
+ is placed under the working directory following the McStas `mcrun` convention.
67
+
68
+ Command line flags and parameters are mostly the same as used by `mcrun` with a number
69
+ of additions to support `splitrun`'s enhanced behavior.
70
+ One optional argument, `split-at`, is added; it should be the name of
71
+ an `Arm` component inside the instrument file and defaults to `mcpl_split`.
72
72
  In contrast to `mcrun`, instrument parameters for `splitrun` are specified as 'MATLAB'-range style keyword arguments.
73
73
  A valid range is inclusive of its end points and of the form `start:step:end` or `start:end` (with implicit `step=1`).
74
74
 
@@ -103,7 +103,7 @@ mcrun my_instrument.instr -N 90 -n 1000000 -d /data/output sample_angle=1,90 sam
103
103
  ```
104
104
  can be replaced by the `splitrun` command
105
105
  ```bash
106
- splitrun my_instrument.instr -n 1000000 -d /data/output sample_angle=1:90 sample_radius=10.0
106
+ splitrun my_instrument.instr -n 1000000 --split-at split_at -d /data/output sample_angle=1:90 sample_radius=10.0
107
107
  ```
108
108
 
109
109
 
@@ -8,14 +8,14 @@ restage/energy.py,sha256=w78GUIWcHxANvBl2DTu73FQFawCXfzlK6L32TBQNt4g,3371
8
8
  restage/instr.py,sha256=A0ShtXkswt_f7o-cIDtsVbG03_tGELe1aS3WzLxzkJM,2494
9
9
  restage/mcpl.py,sha256=MKVY-2TYk5p8hW1lXJib5mxdbnILq4GoYiyAUgOBJmA,3269
10
10
  restage/range.py,sha256=TjOf4DSKfgoAIcrWQvv6MrtksQpnGJHdsEjVI5K-UfI,8116
11
- restage/run.py,sha256=nk8d7cIyIqSt-5pyGm68Zak5H1a-fbo_z2_36eN-08E,1481
11
+ restage/run.py,sha256=bTcQIN9edKMXU_eFdX3E_mtJjwemoARrIUmZqzEGf0E,1475
12
12
  restage/scan.py,sha256=Yx8OQSBG6I2_64sW0LIDb0glVKwWoxUQQznASXgDZFQ,1432
13
13
  restage/splitrun.py,sha256=W_pTeiMjc9hhu-zaE6fdetVLG6MGEpnaTOdgmgVkS1g,26061
14
- restage/tables.py,sha256=mL1SrCbgwfWzG-ezd_R3CxOSIZLNZRoC2r7ht59jGMA,16371
14
+ restage/tables.py,sha256=vQf0GkM7ojQbWee_P_Xqfx0-lXLym7x6kyam8CWpB5s,16373
15
15
  restage/config/__init__.py,sha256=zFRT9QXgpUJpBncELCQ6by1-kjYp8Li1yJDfqxkHxAA,965
16
16
  restage/config/default.yaml,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
17
- restage-0.6.0.dist-info/METADATA,sha256=X4sDrQDtdq4jl0nkymuxCsnxM8QbBJ4_nTiwKWfyNwA,6769
18
- restage-0.6.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
19
- restage-0.6.0.dist-info/entry_points.txt,sha256=gghocSxC2gHHxUCalAibCN1mtkh3trNmAfH5Qwx0KYg,149
20
- restage-0.6.0.dist-info/top_level.txt,sha256=iM_pb-taTZ0S2WMoDnt_qDMZoNMjmM19z3tTCuVm1IE,8
21
- restage-0.6.0.dist-info/RECORD,,
17
+ restage-0.7.0.dist-info/METADATA,sha256=VTicESA3b8fD__6eT-P_Upsx8Nb8AygdlMqT9K50PN8,6606
18
+ restage-0.7.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
19
+ restage-0.7.0.dist-info/entry_points.txt,sha256=vYNOPxJ4PzG-1GGFSd08jFxhrtKUWAdWzjJQeFBzFJE,116
20
+ restage-0.7.0.dist-info/top_level.txt,sha256=iM_pb-taTZ0S2WMoDnt_qDMZoNMjmM19z3tTCuVm1IE,8
21
+ restage-0.7.0.dist-info/RECORD,,
@@ -1,4 +1,3 @@
1
1
  [console_scripts]
2
- restage = restage.run:entrypoint
3
2
  restage_bifrost_choppers = restage.bifrost_choppers:script
4
3
  splitrun = restage.splitrun:entrypoint