moreniius 0.2.2__tar.gz → 0.2.4__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 (29) hide show
  1. {moreniius-0.2.2 → moreniius-0.2.4}/.github/workflows/pip.yml +1 -1
  2. {moreniius-0.2.2 → moreniius-0.2.4}/.github/workflows/wheels.yml +3 -3
  3. {moreniius-0.2.2/src/moreniius.egg-info → moreniius-0.2.4}/PKG-INFO +5 -5
  4. {moreniius-0.2.2 → moreniius-0.2.4}/pyproject.toml +4 -4
  5. {moreniius-0.2.2 → moreniius-0.2.4}/src/moreniius/mccode/instr.py +17 -1
  6. {moreniius-0.2.2 → moreniius-0.2.4}/src/moreniius/mccode/orientation.py +0 -2
  7. {moreniius-0.2.2 → moreniius-0.2.4}/src/moreniius/writer.py +0 -2
  8. {moreniius-0.2.2 → moreniius-0.2.4/src/moreniius.egg-info}/PKG-INFO +5 -5
  9. moreniius-0.2.4/src/moreniius.egg-info/requires.txt +7 -0
  10. moreniius-0.2.2/src/moreniius.egg-info/requires.txt +0 -7
  11. {moreniius-0.2.2 → moreniius-0.2.4}/.gitignore +0 -0
  12. {moreniius-0.2.2 → moreniius-0.2.4}/README.md +0 -0
  13. {moreniius-0.2.2 → moreniius-0.2.4}/setup.cfg +0 -0
  14. {moreniius-0.2.2 → moreniius-0.2.4}/src/moreniius/__init__.py +0 -0
  15. {moreniius-0.2.2 → moreniius-0.2.4}/src/moreniius/additions.py +0 -0
  16. {moreniius-0.2.2 → moreniius-0.2.4}/src/moreniius/mccode/__init__.py +0 -0
  17. {moreniius-0.2.2 → moreniius-0.2.4}/src/moreniius/mccode/comp.py +0 -0
  18. {moreniius-0.2.2 → moreniius-0.2.4}/src/moreniius/mccode/instance.py +0 -0
  19. {moreniius-0.2.2 → moreniius-0.2.4}/src/moreniius/mccode/mccode.py +0 -0
  20. {moreniius-0.2.2 → moreniius-0.2.4}/src/moreniius/moreniius.py +0 -0
  21. {moreniius-0.2.2 → moreniius-0.2.4}/src/moreniius/nexus_structure.py +0 -0
  22. {moreniius-0.2.2 → moreniius-0.2.4}/src/moreniius/nxoff.py +0 -0
  23. {moreniius-0.2.2 → moreniius-0.2.4}/src/moreniius/utils.py +0 -0
  24. {moreniius-0.2.2 → moreniius-0.2.4}/src/moreniius.egg-info/SOURCES.txt +0 -0
  25. {moreniius-0.2.2 → moreniius-0.2.4}/src/moreniius.egg-info/dependency_links.txt +0 -0
  26. {moreniius-0.2.2 → moreniius-0.2.4}/src/moreniius.egg-info/entry_points.txt +0 -0
  27. {moreniius-0.2.2 → moreniius-0.2.4}/src/moreniius.egg-info/top_level.txt +0 -0
  28. {moreniius-0.2.2 → moreniius-0.2.4}/tests/test_motorized_positions.py +0 -0
  29. {moreniius-0.2.2 → moreniius-0.2.4}/tests/test_nexus_structure.py +0 -0
@@ -20,7 +20,7 @@ jobs:
20
20
  steps:
21
21
  - uses: actions/checkout@v4
22
22
 
23
- - uses: actions/setup-python@v4
23
+ - uses: actions/setup-python@v5
24
24
  with:
25
25
  python-version: ${{ matrix.python-version }}
26
26
 
@@ -26,7 +26,7 @@ jobs:
26
26
  - name: Check metadata
27
27
  run: pipx run twine check dist/*
28
28
 
29
- - uses: actions/upload-artifact@v3
29
+ - uses: actions/upload-artifact@v4
30
30
  with:
31
31
  path: dist/*
32
32
 
@@ -42,9 +42,9 @@ jobs:
42
42
  if: github.event_name == 'release' && github.event.action == 'published'
43
43
 
44
44
  steps:
45
- - uses: actions/setup-python@v4
45
+ - uses: actions/setup-python@v5
46
46
 
47
- - uses: actions/download-artifact@v3
47
+ - uses: actions/download-artifact@v4
48
48
  with:
49
49
  name: artifact
50
50
  path: dist
@@ -1,15 +1,15 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: moreniius
3
- Version: 0.2.2
3
+ Version: 0.2.4
4
4
  Author-email: Gregory Tucker <gregory.tucker@ess.eu>
5
5
  Classifier: License :: OSI Approved :: BSD License
6
6
  Classifier: Development Status :: 2 - Pre-Alpha
7
7
  Description-Content-Type: text/markdown
8
- Requires-Dist: zenlog==1.1
9
- Requires-Dist: platformdirs==3.11
8
+ Requires-Dist: zenlog>=1.1
9
+ Requires-Dist: platformdirs>=3.11
10
10
  Requires-Dist: importlib_metadata; python_version < "3.8"
11
- Requires-Dist: mccode-antlr[hdf5]==0.7.0
12
- Requires-Dist: nexusformat==1.0.6
11
+ Requires-Dist: mccode-antlr[hdf5]>=0.7.1
12
+ Requires-Dist: nexusformat>=1.0.6
13
13
 
14
14
  # moreniius
15
15
  A project to contain custom components required to use `eniius` to produce `NeXus Structure` `JSON` from `mccode-antlr` simulated instruments.
@@ -5,11 +5,11 @@ build-backend = "setuptools.build_meta"
5
5
  [project]
6
6
  name = "moreniius"
7
7
  dependencies = [
8
- 'zenlog==1.1,',
9
- 'platformdirs==3.11',
8
+ 'zenlog>=1.1',
9
+ 'platformdirs>=3.11',
10
10
  "importlib_metadata; python_version<'3.8'",
11
- 'mccode-antlr[hdf5]==0.7.0',
12
- 'nexusformat==1.0.6'
11
+ 'mccode-antlr[hdf5]>=0.7.1',
12
+ 'nexusformat>=1.0.6'
13
13
  ]
14
14
  readme = "README.md"
15
15
  authors = [
@@ -83,8 +83,24 @@ class NXInstr:
83
83
  'expression' in nx_args[0]:
84
84
  not_expr = [x for x in nx_args[0] if x != 'expression']
85
85
  if len(not_expr) == 1:
86
+ not_expr_arg = nx_args[0][not_expr[0]]
87
+ if isinstance(not_expr_arg, NXfield):
88
+ # We have and want an NXfield, but it might be missing attributes specified in the nx_kwargs
89
+ # Passing the keywords to the NXfield constructor versus this method is not identical,
90
+ # since some keyword arguments are reserved (and only some of which are noted)
91
+ # Explicit keywords, used in the constructor:
92
+ # value, name, shape, dtype, group, attrs
93
+ # Keywords extracted from the kwargs dict, if present (and all controlling HDF5 file attributes?):
94
+ # chunks, compression, compression_opts, fillvalue, fletcher32, maxshape, scaleoffset, shuffle
95
+ # For now, just assume all keywords provided here are _actually_ attributes for the NXfield
96
+ # which is an extension of a dict, but can *not* use the update method, since the __setitem__
97
+ # method is overridden to wrap inputs in NXattr objects :/
98
+ for k, v in nx_kwargs.items():
99
+ not_expr_arg.attrs[k] = v
100
+ return not_expr_arg
101
+
86
102
  # TODO make this return an nx_class once we're sure that nx_kwargs is parseable (no mccode_antlr.Expr)
87
- return nx_class(nx_args[0][not_expr[0]], **nx_kwargs)
103
+ return nx_class(not_expr_arg, **nx_kwargs)
88
104
  else:
89
105
  raise RuntimeError('Not sure what I should do here')
90
106
  return nx_class(*nx_args, **nx_kwargs)
@@ -28,7 +28,6 @@ class NXPart:
28
28
  pos = self.o.position()
29
29
  if any(isinstance(c, (Expr, Value)) for c in (pos.x, pos.y, pos.z)):
30
30
  translations = []
31
- print(f'{pos.x=} {pos.y=} {pos.z=}')
32
31
  for n, c, v in (('x', pos.x, [1, 0, 0]), ('y', pos.y, [0, 1, 0]), ('z', pos.z, [0, 0, 1])):
33
32
  if c != Expr.parse('0'):
34
33
  next_name = f'{name}_{n}'
@@ -51,7 +50,6 @@ class NXPart:
51
50
  print(repr(self.o))
52
51
  raise NotImplementedError()
53
52
 
54
- # print(f'rotation {axis}, {angle}')
55
53
  # handle the case where angle is not a constant?
56
54
  return self.make_nx(NXfield, angle, vector=axis, depends_on=dep, transformation_type='rotation', units=angle_unit)
57
55
 
@@ -113,7 +113,6 @@ class Writer:
113
113
  if absolute_depends_on and 'depends_on' == name and not obj.nxdata.startswith('/'):
114
114
  obj.nxdata = _to_absolute(top_obj.nxpath, obj.nxdata)
115
115
  if obj.nxclass == 'NXfield':
116
- # print(f'to_json_dict for NXfield {name=}')
117
116
  typ, val = convert_types(obj.nxdata, only_nx)
118
117
  # typ is None if obj.nxdata is a NotNXdict (such that val _is_ the contained dict)
119
118
  entry = dict(module='dataset', config=dict(name=name, values=val, type=typ)) if typ else val
@@ -123,7 +122,6 @@ class Writer:
123
122
  if len(list(obj)):
124
123
  entry['children'] = self._to_json_dict(obj, only_nx=only_nx, absolute_depends_on=absolute_depends_on)
125
124
  for n, v in obj.attrs.items():
126
- # print(f'to_json_dict for attribute of {name=}, named {n=}')
127
125
  typ, val = convert_types(v, only_nx)
128
126
  if absolute_depends_on and n == 'depends_on' and '/' != val[0]:
129
127
  val = _to_absolute(top_obj.nxpath, val)
@@ -1,15 +1,15 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: moreniius
3
- Version: 0.2.2
3
+ Version: 0.2.4
4
4
  Author-email: Gregory Tucker <gregory.tucker@ess.eu>
5
5
  Classifier: License :: OSI Approved :: BSD License
6
6
  Classifier: Development Status :: 2 - Pre-Alpha
7
7
  Description-Content-Type: text/markdown
8
- Requires-Dist: zenlog==1.1
9
- Requires-Dist: platformdirs==3.11
8
+ Requires-Dist: zenlog>=1.1
9
+ Requires-Dist: platformdirs>=3.11
10
10
  Requires-Dist: importlib_metadata; python_version < "3.8"
11
- Requires-Dist: mccode-antlr[hdf5]==0.7.0
12
- Requires-Dist: nexusformat==1.0.6
11
+ Requires-Dist: mccode-antlr[hdf5]>=0.7.1
12
+ Requires-Dist: nexusformat>=1.0.6
13
13
 
14
14
  # moreniius
15
15
  A project to contain custom components required to use `eniius` to produce `NeXus Structure` `JSON` from `mccode-antlr` simulated instruments.
@@ -0,0 +1,7 @@
1
+ zenlog>=1.1
2
+ platformdirs>=3.11
3
+ mccode-antlr[hdf5]>=0.7.1
4
+ nexusformat>=1.0.6
5
+
6
+ [:python_version < "3.8"]
7
+ importlib_metadata
@@ -1,7 +0,0 @@
1
- zenlog==1.1
2
- platformdirs==3.11
3
- mccode-antlr[hdf5]==0.7.0
4
- nexusformat==1.0.6
5
-
6
- [:python_version < "3.8"]
7
- importlib_metadata
File without changes
File without changes
File without changes