restage 0.6.0__tar.gz → 0.7.0__tar.gz

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.
Files changed (37) hide show
  1. {restage-0.6.0/src/restage.egg-info → restage-0.7.0}/PKG-INFO +16 -16
  2. {restage-0.6.0 → restage-0.7.0}/README.md +14 -14
  3. {restage-0.6.0 → restage-0.7.0}/pyproject.toml +1 -2
  4. {restage-0.6.0 → restage-0.7.0}/src/restage/run.py +1 -1
  5. {restage-0.6.0 → restage-0.7.0}/src/restage/tables.py +1 -1
  6. {restage-0.6.0 → restage-0.7.0/src/restage.egg-info}/PKG-INFO +16 -16
  7. {restage-0.6.0 → restage-0.7.0}/src/restage.egg-info/entry_points.txt +0 -1
  8. {restage-0.6.0 → restage-0.7.0}/src/restage.egg-info/requires.txt +1 -1
  9. {restage-0.6.0 → restage-0.7.0}/test/test_single.py +2 -7
  10. {restage-0.6.0 → restage-0.7.0}/.github/workflows/pip.yml +0 -0
  11. {restage-0.6.0 → restage-0.7.0}/.github/workflows/wheels.yml +0 -0
  12. {restage-0.6.0 → restage-0.7.0}/.gitignore +0 -0
  13. {restage-0.6.0 → restage-0.7.0}/setup.cfg +0 -0
  14. {restage-0.6.0 → restage-0.7.0}/src/restage/__init__.py +0 -0
  15. {restage-0.6.0 → restage-0.7.0}/src/restage/bifrost_choppers.py +0 -0
  16. {restage-0.6.0 → restage-0.7.0}/src/restage/cache.py +0 -0
  17. {restage-0.6.0 → restage-0.7.0}/src/restage/config/__init__.py +0 -0
  18. {restage-0.6.0 → restage-0.7.0}/src/restage/config/default.yaml +0 -0
  19. {restage-0.6.0 → restage-0.7.0}/src/restage/cspec_choppers.py +0 -0
  20. {restage-0.6.0 → restage-0.7.0}/src/restage/database.py +0 -0
  21. {restage-0.6.0 → restage-0.7.0}/src/restage/emulate.py +0 -0
  22. {restage-0.6.0 → restage-0.7.0}/src/restage/energy.py +0 -0
  23. {restage-0.6.0 → restage-0.7.0}/src/restage/instr.py +0 -0
  24. {restage-0.6.0 → restage-0.7.0}/src/restage/mcpl.py +0 -0
  25. {restage-0.6.0 → restage-0.7.0}/src/restage/range.py +0 -0
  26. {restage-0.6.0 → restage-0.7.0}/src/restage/scan.py +0 -0
  27. {restage-0.6.0 → restage-0.7.0}/src/restage/splitrun.py +0 -0
  28. {restage-0.6.0 → restage-0.7.0}/src/restage.egg-info/SOURCES.txt +0 -0
  29. {restage-0.6.0 → restage-0.7.0}/src/restage.egg-info/dependency_links.txt +0 -0
  30. {restage-0.6.0 → restage-0.7.0}/src/restage.egg-info/top_level.txt +0 -0
  31. {restage-0.6.0 → restage-0.7.0}/test/test_cache.py +0 -0
  32. {restage-0.6.0 → restage-0.7.0}/test/test_cache_ro.py +0 -0
  33. {restage-0.6.0 → restage-0.7.0}/test/test_database.py +0 -0
  34. {restage-0.6.0 → restage-0.7.0}/test/test_energy.py +0 -0
  35. {restage-0.6.0 → restage-0.7.0}/test/test_env_vars.py +0 -0
  36. {restage-0.6.0 → restage-0.7.0}/test/test_range.py +0 -0
  37. {restage-0.6.0 → restage-0.7.0}/test/test_scan.py +0 -0
@@ -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
 
@@ -30,21 +30,21 @@ pip install git+https://github.com/g5t/restage.git
30
30
  ```
31
31
 
32
32
  ## Usage
33
- ### `restage`
34
- The `restage` module provides a function, `restage`, which takes a McStas instrument file as input.
35
- The function will then parse the instrument file and generate new instrument files for the first and second stage simulations.
36
- The new instrument files will be named `restaged_lower_<original instrument file name>.instr`,
37
- and `restaged_upper_<original instrument file name>.instr`, respectively.
38
33
 
39
34
  ### `splitrun`
40
- A more useful function, `splitrun`, is also provided by the `restage` module.
41
- The `splitrun` function takes the same arguments as the `restage` function,
42
- but will also run the simulations for the first and second stage.
43
- The function will return the output of the second stage simulation.
44
-
45
- The `splitrun` function can be used as a replacement for the `mcrun` function distributed as part of McStas.
46
- One optional argument, `splitpoint`, is added to the `splitrun` function; it should be the name of
47
- an `Arm` component inside the instrument file and defaults to `split_at`.
35
+ The `restage` module provides a command line program, `splitrun`, which
36
+ can be used as a replacement for the `mcrun` function distributed as part of McStas.
37
+
38
+ `splitrun` produces two instrument stages, before and after a split point, and runs
39
+ the specified parameter set(s) in both stages connecting the two through cached MCPL
40
+ state files.
41
+ The first stage results are stored in a user cache directory and the second stage output
42
+ is placed under the working directory following the McStas `mcrun` convention.
43
+
44
+ Command line flags and parameters are mostly the same as used by `mcrun` with a number
45
+ of additions to support `splitrun`'s enhanced behavior.
46
+ One optional argument, `split-at`, is added; it should be the name of
47
+ an `Arm` component inside the instrument file and defaults to `mcpl_split`.
48
48
  In contrast to `mcrun`, instrument parameters for `splitrun` are specified as 'MATLAB'-range style keyword arguments.
49
49
  A valid range is inclusive of its end points and of the form `start:step:end` or `start:end` (with implicit `step=1`).
50
50
 
@@ -79,7 +79,7 @@ mcrun my_instrument.instr -N 90 -n 1000000 -d /data/output sample_angle=1,90 sam
79
79
  ```
80
80
  can be replaced by the `splitrun` command
81
81
  ```bash
82
- splitrun my_instrument.instr -n 1000000 -d /data/output sample_angle=1:90 sample_radius=10.0
82
+ splitrun my_instrument.instr -n 1000000 --split-at split_at -d /data/output sample_angle=1:90 sample_radius=10.0
83
83
  ```
84
84
 
85
85
 
@@ -9,7 +9,7 @@ dependencies = [
9
9
  'platformdirs>=3.11',
10
10
  'confuse',
11
11
  'psutil>=5.9.6',
12
- 'mccode-antlr[hdf5]>=0.13.0',
12
+ 'mccode-antlr[hdf5]>=0.14.0',
13
13
  ]
14
14
  readme = "README.md"
15
15
  license = {text = "BSD-3-Clause"}
@@ -33,7 +33,6 @@ dynamic = ["version"]
33
33
  test = ["pytest", "chopcal"]
34
34
 
35
35
  [project.scripts]
36
- restage = "restage.run:entrypoint"
37
36
  splitrun = "restage.splitrun:entrypoint"
38
37
  restage_bifrost_choppers = "restage.bifrost_choppers:script"
39
38
 
@@ -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,
@@ -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
 
@@ -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
@@ -2,7 +2,7 @@ zenlog>=1.1
2
2
  platformdirs>=3.11
3
3
  confuse
4
4
  psutil>=5.9.6
5
- mccode-antlr[hdf5]>=0.13.0
5
+ mccode-antlr[hdf5]>=0.14.0
6
6
 
7
7
  [test]
8
8
  pytest
@@ -148,12 +148,7 @@ class SplitRunTestCase(unittest.TestCase):
148
148
 
149
149
  def _define_instr(self):
150
150
  from math import pi, asin, sqrt
151
- from mccode_antlr.reader import MCSTAS_REGISTRY
152
- from mccode_antlr.loader.loader import parse_mccode_instr
153
-
154
- def parse(contents):
155
- registries = [MCSTAS_REGISTRY]
156
- return parse_mccode_instr(contents, registries, '<test string>')
151
+ from mccode_antlr.loader.loader import parse_mcstas_instr
157
152
 
158
153
  d_spacing = 3.355 # (002) for Highly-ordered Pyrolytic Graphite
159
154
  mean_energy = 5.0
@@ -193,7 +188,7 @@ class SplitRunTestCase(unittest.TestCase):
193
188
  COMPONENT detector = Monitor(xwidth=0.01, yheight=0.05) AT (0, 0, 0.8) RELATIVE sample_arm
194
189
  END
195
190
  """
196
- return parse(instr), min_a1, max_a1
191
+ return parse_mcstas_instr(instr), min_a1, max_a1
197
192
 
198
193
  def setUp(self) -> None:
199
194
  from pathlib import Path
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes