restage 0.2.2__py3-none-any.whl → 0.2.3__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/splitrun.py CHANGED
@@ -162,6 +162,7 @@ def splitrun(instr, parameters, precision: dict[str, float], split_at=None, grid
162
162
  maximum_particle_count=None,
163
163
  dry_run=False,
164
164
  callback=None, callback_arguments: dict[str, str] | None = None,
165
+ output_split_instrs=True,
165
166
  **runtime_arguments):
166
167
  from zenlog import log
167
168
  from .energy import get_energy_parameter_names
@@ -172,6 +173,10 @@ def splitrun(instr, parameters, precision: dict[str, float], split_at=None, grid
172
173
  log.error(f'The specified split-at component, {split_at}, does not exist in the instrument file')
173
174
  # splitting defines an instrument parameter in both returned instrument, 'mcpl_filename'.
174
175
  pre, post = instr.mcpl_split(split_at, remove_unused_parameters=True)
176
+ if output_split_instrs:
177
+ for p in (pre, post):
178
+ with open(f'{p.name}.instr', 'w') as f:
179
+ p.to_file(f)
175
180
  # ... reduce the parameters to those that are relevant to the two instruments.
176
181
  pre_parameters = {k: v for k, v in parameters.items() if pre.has_parameter(k)}
177
182
  post_parameters = {k: v for k, v in parameters.items() if post.has_parameter(k)}
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: restage
3
- Version: 0.2.2
3
+ Version: 0.2.3
4
4
  Author-email: Gregory Tucker <gregory.tucker@ess.eu>
5
5
  Classifier: License :: OSI Approved :: BSD License
6
6
  Description-Content-Type: text/markdown
@@ -10,10 +10,10 @@ restage/mcpl.py,sha256=0F9A_edwSR9awQipicI3ipsMAJFk9zCspJhCOrmhkDg,2407
10
10
  restage/range.py,sha256=TjOf4DSKfgoAIcrWQvv6MrtksQpnGJHdsEjVI5K-UfI,8116
11
11
  restage/run.py,sha256=nk8d7cIyIqSt-5pyGm68Zak5H1a-fbo_z2_36eN-08E,1481
12
12
  restage/scan.py,sha256=Yx8OQSBG6I2_64sW0LIDb0glVKwWoxUQQznASXgDZFQ,1432
13
- restage/splitrun.py,sha256=zCm9CHoD8Jr4_Db9FFzJz3ZyV5oxUXI_UfVhmYxUrYw,23161
13
+ restage/splitrun.py,sha256=QXmQOZ14EUdhBOzLwX1djTg9kPmxqi0bZJHQWsb3mhs,23339
14
14
  restage/tables.py,sha256=VMApcu4KtsBlUvAqCSKHDZ58FXhNPihr90OU12YAejw,15764
15
- restage-0.2.2.dist-info/METADATA,sha256=7U8nX3RuatOZ22Ybd716BII6Nm4jmlvTt1s4NypHb-I,4773
16
- restage-0.2.2.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
17
- restage-0.2.2.dist-info/entry_points.txt,sha256=dY3ZanXW6rBLd2vBo-WMcbgO7E10GVDE0t9GASuVjgY,90
18
- restage-0.2.2.dist-info/top_level.txt,sha256=iM_pb-taTZ0S2WMoDnt_qDMZoNMjmM19z3tTCuVm1IE,8
19
- restage-0.2.2.dist-info/RECORD,,
15
+ restage-0.2.3.dist-info/METADATA,sha256=R841jq2QHA77mFgGiz2e1IxKfsNz3BmeuCFdPNkA5qg,4773
16
+ restage-0.2.3.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
17
+ restage-0.2.3.dist-info/entry_points.txt,sha256=dY3ZanXW6rBLd2vBo-WMcbgO7E10GVDE0t9GASuVjgY,90
18
+ restage-0.2.3.dist-info/top_level.txt,sha256=iM_pb-taTZ0S2WMoDnt_qDMZoNMjmM19z3tTCuVm1IE,8
19
+ restage-0.2.3.dist-info/RECORD,,