Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
1033 commits
Select commit Hold shift + click to select a range
7e1a55c
Start parsing SESANS sample metadata
rprospero May 6, 2025
48de65f
Include SESANS angle metadata
rprospero May 6, 2025
670621d
Multiple SESANS files in reader test
rprospero May 6, 2025
baa86f4
Parse actual data from SES files
rprospero May 6, 2025
474066c
Add Raw SESANS Node Data
rprospero May 7, 2025
f38bdb5
Update XML test references to include apertures
rprospero May 7, 2025
bc84402
SESANS metadata as a process, not an aperture
rprospero May 7, 2025
2703025
Fixup lint
rprospero May 7, 2025
d016020
Make changes suggested in PR review
rprospero May 19, 2025
b57ac2d
Fix simple typos from rebase
rprospero Jun 3, 2025
2e8b76a
Add equality testing for quantities
rprospero Jun 10, 2025
ed0988a
More tests for quantities
rprospero Jun 10, 2025
061a4ff
Fix meshmerge calculation
rprospero Jun 17, 2025
2f39573
Ruff format.
jamescrake-merani Jun 23, 2025
f0c9a96
This comment was repetitive.
jamescrake-merani Jun 23, 2025
b4218f5
Ruff format.
jamescrake-merani Jun 24, 2025
fa0cd6f
Function to guess the dataset type.
jamescrake-merani Jun 24, 2025
f33dd38
Function for loading a file with default params.
jamescrake-merani Jun 24, 2025
c5978c4
Ruff format.
jamescrake-merani Jun 24, 2025
0c00d6f
Remove imports ruff is complaining aren't used.
jamescrake-merani Jun 24, 2025
2204476
Added a test to make sure 2d data gets read right.
jamescrake-merani Jun 24, 2025
1e066f9
Makes sure the dataset type gets guessed.
jamescrake-merani Jun 24, 2025
95478a6
Use basename for sasdata ascii name.
jamescrake-merani Jun 25, 2025
1fba61f
Be consistent with how basename is called.
jamescrake-merani Jul 4, 2025
5c514bf
Move comment to avoid odd Ruff format.
jamescrake-merani Jul 4, 2025
bd01002
Move comment again.
jamescrake-merani Jul 4, 2025
b54d8e8
Fixed test.
jamescrake-merani Jul 4, 2025
9dafc71
Created an import metadata function.
jamescrake-merani Jul 7, 2025
dbf5abe
Remove the old function.
jamescrake-merani Jul 7, 2025
f695d14
Use the new import function.
jamescrake-merani Jul 7, 2025
cf02949
Remove these imports.
jamescrake-merani Jul 7, 2025
dadbe6e
Need to use keywords for this dataclass.
jamescrake-merani Jul 7, 2025
f2415bc
Import the mumag data for testing.
jamescrake-merani Jul 7, 2025
4bdc193
Added a case for mumag data.
jamescrake-merani Jul 7, 2025
df8cb0d
Added test for loading ascii data with metadata.
jamescrake-merani Jul 7, 2025
47be93f
Use params filenames not just filenames.
jamescrake-merani Jul 7, 2025
956d9ef
Fixed column parameters.
jamescrake-merani Jul 7, 2025
7ae0fc2
Doh. Missing commas on filename list.
jamescrake-merani Jul 7, 2025
311c551
Roll the raw metadata into the metadata object.
jamescrake-merani Jul 7, 2025
dd2c193
Need to fill in all the parameters.
jamescrake-merani Jul 7, 2025
bb33506
Forgot process :P
jamescrake-merani Jul 7, 2025
57bd658
Consider both of these.
jamescrake-merani Jul 7, 2025
63b3f63
Combine both metadata so we go through all of them
jamescrake-merani Jul 7, 2025
c4e8033
Raw metadata is in lists.
jamescrake-merani Jul 7, 2025
9c09000
I don't know what these decimals were.
jamescrake-merani Jul 7, 2025
290a27b
Start implementing ModellingRequirements
rprospero Jun 18, 2025
79b0cf4
Start testing modelling requirements
rprospero Jun 18, 2025
d998d50
Start adding better tests for ModellingRequirements
rprospero Jun 18, 2025
f36c5ae
Flip order of parameters on compose
rprospero Jun 18, 2025
b9fc38f
Don't assume that Sesans includes smear
rprospero Jun 18, 2025
6231e85
Enable left composition by null model
rprospero Jun 18, 2025
d657e31
support right addition of NullModel
rprospero Jun 18, 2025
e7464cb
Allow preprocess and postprocess steps
rprospero Jun 18, 2025
5587e6b
Start performing Hankel transform for SESANS
rprospero Jun 18, 2025
2567737
Ignore slit smearing before SESANS
rprospero Jun 20, 2025
9fd244e
Pull sesans metadata from file
rprospero Jun 20, 2025
022a680
Add unit test for Hankel transform
rprospero Jun 20, 2025
a18a506
Fix units with error calculation
rprospero Jun 20, 2025
3652548
χ² squared based test
rprospero Jun 20, 2025
736c584
Code Review Suggestions
rprospero Jun 20, 2025
035c2f2
Fix up rename in compose
rprospero Jun 20, 2025
280dbc4
Fix uncertainty in SESANS parser
rprospero Jul 1, 2025
5123a59
Update SESANS units in unit_kinds
rprospero Jul 14, 2025
47ba3db
Applies auto fixes for ruff rule F401
DrPaulSharp Jul 17, 2025
983c680
Applies auto fixes for ruff rule E714
DrPaulSharp Jul 17, 2025
4417fb9
Applies auto fixes for ruff rule F541
DrPaulSharp Jul 17, 2025
513515f
Test should fail when there's no data.
Jul 18, 2025
2dedd30
Added a get default unit function.
Jul 18, 2025
9a1ecd1
Use the new get default unit function.
Jul 18, 2025
b2226d4
Pass in the unit group as well.
Jul 18, 2025
1c4122c
Return value if it isn't None.
Jul 18, 2025
fc5cd56
Set the dataset type properly.
Jul 18, 2025
019a3a9
Expect 2D test to fail.
Jul 18, 2025
9ad39a9
Use Quantity in models
rprospero Jul 14, 2025
eb1977a
Don't use a quantity for model post processing
rprospero Jul 14, 2025
24c67c3
Basic Pinhole model
rprospero Jul 14, 2025
037393d
Refactor pinhole tests
rprospero Jul 15, 2025
a013c50
Fix radius bug in smearing
rprospero Jul 17, 2025
673b7bc
More realisting δq
rprospero Jul 18, 2025
ef71e5d
Combine Smearing and Sesans tests
rprospero Jul 17, 2025
8430102
Define model metadata in constructor
rprospero Jul 18, 2025
b20c067
Better testing range for pinhole
rprospero Jul 18, 2025
068d29c
Add slit smearing
rprospero Jul 18, 2025
15c7ba8
Remove old commented code
rprospero Jul 18, 2025
96d9671
Vectorise slit calculation
rprospero Jul 21, 2025
b099180
Check combination of slit models
rprospero Jul 21, 2025
7bbf9c5
Decrease logical depth of linear_extrapolation
rprospero Jul 31, 2025
9bac0bd
Decrease logical depth of slit_resolution
rprospero Jul 31, 2025
a307bec
Decrease logical depth of geometric_extrapolation
rprospero Jul 31, 2025
b2cfbfc
Apply PR changes
rprospero Jul 31, 2025
ce068b2
Fixes ruff linting errors (#140)
DrPaulSharp Aug 1, 2025
c942319
Adds Pyupgrade (UP) ruleset and rules SIM118 & SIM300 to ruff linter …
DrPaulSharp Aug 6, 2025
75b2f6e
Applies fixes for isort (I) ruff ruleset (#146)
DrPaulSharp Aug 7, 2025
5a5cb8c
Fixes whitespace errors
DrPaulSharp Aug 6, 2025
4670a54
Fix hours, days, and years
rprospero Aug 1, 2025
4e2a92f
Add command for explicitly formatting quantity units
rprospero Aug 1, 2025
5cac885
Add test harness for serialisation
rprospero Jun 3, 2025
0b9bea4
Add first real json property
rprospero Aug 1, 2025
7b49122
Export data type
rprospero Aug 1, 2025
a447a36
Add mask and model requirements
rprospero Aug 1, 2025
ab65f42
Start exporting metadata
rprospero Aug 1, 2025
0142e1f
Start adding sample details
rprospero Aug 1, 2025
532c914
Export process metadata
rprospero Aug 1, 2025
4ab3daa
Export Instrument and Raw metadata
rprospero Aug 1, 2025
1dfc6b5
Support exporting Quantities
rprospero Aug 1, 2025
9442b4b
Remove unneeded default calls
rprospero Aug 1, 2025
bb9bbdf
Start writing decoder
rprospero Aug 1, 2025
e332179
Correctly export sample temperature
rprospero Aug 1, 2025
71cb035
Fix notes nodes type
rprospero Aug 1, 2025
9590fb1
Decode metadata from json
rprospero Aug 1, 2025
7402edc
Use proper bytes for numpy serialisation
rprospero Aug 11, 2025
19b0f96
Fix historical unit errors
rprospero Aug 1, 2025
d91c5d5
Parse MetaNode
rprospero Aug 1, 2025
9ef81de
Use .json extension for JSON files
rprospero Aug 11, 2025
996af20
Establish settings for ruff and pycodestyle
rprospero Aug 12, 2025
caf7045
Fix formatting
rprospero Aug 12, 2025
c3c94e0
[pre-commit.ci lite] apply automatic fixes for ruff linting errors
pre-commit-ci-lite[bot] Aug 12, 2025
8f38d49
Adds main check to "transforms.py"
DrPaulSharp Aug 13, 2025
14fed8c
Start descending
rprospero Aug 12, 2025
74fc740
Convert tail call recursion to loop
rprospero Aug 13, 2025
16a276f
Enumerate keys for access
rprospero Aug 13, 2025
215d747
Descend into dicts
rprospero Aug 13, 2025
a489519
Fix access to dict items
rprospero Aug 13, 2025
d83be1d
Fix formatting and doctstrings
rprospero Aug 13, 2025
42f23f4
Enable tag collection
rprospero Aug 13, 2025
a394fd8
Fix PR Comments
rprospero Aug 13, 2025
5101115
Formatting fixes
rprospero Aug 14, 2025
b8c66f0
Start encoding
rprospero Aug 15, 2025
50b8b7c
Test saving with XML files
rprospero Sep 8, 2025
511747a
More tests for sample metadata
rprospero Sep 8, 2025
68dfa9a
Switch to safe asserts
rprospero Sep 8, 2025
55eff34
Start serialising process
rprospero Sep 9, 2025
7663bfb
Start serialising process
rprospero Sep 9, 2025
e964b56
Write instrument tests
rprospero Sep 9, 2025
c99a7c7
Start testing g5 round trip
rprospero Sep 10, 2025
cc1f1af
Fix *most* of the round trip issues
rprospero Sep 10, 2025
1b7c770
Everything passes if we ignore raw
rprospero Sep 10, 2025
4b9aaf5
Start trying to serialise raw data
rprospero Sep 10, 2025
3772fad
Simplify test setup
rprospero Sep 10, 2025
5f15ab6
[pre-commit.ci lite] apply automatic fixes for ruff linting errors
pre-commit-ci-lite[bot] Sep 12, 2025
2ac6e1b
Attach metadata to every entry
rprospero Sep 11, 2025
c9bde61
Add comments to as_h5
rprospero Sep 11, 2025
f690ef0
Fix up file handling of test
rprospero Sep 11, 2025
27161a6
[pre-commit.ci lite] apply automatic fixes for ruff linting errors
pre-commit-ci-lite[bot] Sep 12, 2025
8c039ef
Remove debugging print
rprospero Sep 12, 2025
28ccdb1
Respond to PR suggestions
rprospero Sep 24, 2025
7dde840
Adds local pre-commit hook for ruff linting auto fixes
DrPaulSharp Sep 29, 2025
505af6c
Handle bytes type object in units parser
rprospero Sep 24, 2025
85058ae
Fix underline length in metadata export
rprospero Sep 24, 2025
265a265
Fix import of actual sasdata
rprospero Sep 24, 2025
63b6b3f
Tweak json handling
rprospero Sep 24, 2025
a7d4d42
Fix most of HDF file loading
rprospero Sep 24, 2025
f98847b
Properly save multidimensional data
rprospero Sep 26, 2025
5c427b9
Fix parsing of exception in test
rprospero Sep 26, 2025
c2a0ea6
Perform serialisation test on ALL example data
rprospero Sep 26, 2025
00112d8
Export json
rprospero Sep 26, 2025
7777e7a
[pre-commit.ci lite] apply automatic fixes for ruff linting errors
pre-commit-ci-lite[bot] Sep 26, 2025
554d829
Fix json export of data objects
rprospero Sep 26, 2025
77da7c0
Fixes to json export
rprospero Sep 26, 2025
1a7fff5
Respond to PR suggestions
rprospero Oct 7, 2025
dc2e0b7
Use file name as file id
rprospero Oct 7, 2025
295bb59
157 refactor design documentation (#158)
lucas-wilkins Oct 21, 2025
f1c826c
Redesign tests (#155)
jamescrake-merani Oct 22, 2025
890c5b3
Mark dataload test for faster turnaround
rprospero Oct 22, 2025
1d55106
Ruff code formatting
rprospero Oct 22, 2025
b2d36be
Fix up HDF Test case
rprospero Oct 22, 2025
5760151
Start moving HDF tests into James test framework
rprospero Oct 22, 2025
d66da71
Start moving XML into James test framework
rprospero Oct 22, 2025
372e696
Move round trip testing into main framework
rprospero Oct 22, 2025
ddb01ff
Move json testing into test framework
rprospero Oct 22, 2025
cb99f83
Eliminate old testing detritus
rprospero Oct 22, 2025
180d41d
Start on Sesans testing
rprospero Oct 22, 2025
9c2e5e9
[pre-commit.ci lite] apply automatic fixes for ruff linting errors
pre-commit-ci-lite[bot] Oct 22, 2025
c06f7df
Modifies autogen code to match ruff rules
DrPaulSharp Nov 17, 2025
d825267
added rpms and ran to rebuild tables
paulneves77 Nov 17, 2025
dade1cf
ran ruff fixes
paulneves77 Nov 17, 2025
41d6afc
added 3D datatype and added Qz generalizations where obvious
paulneves77 Nov 13, 2025
5f36383
added first attempt at ND binner which can take in I(x,y,z,u,v,...) a…
paulneves77 Nov 13, 2025
ea45300
added rebin and sketch of inplied qz for postprocessing
paulneves77 Nov 14, 2025
84ac772
updated rebin, added rpm to units, and working on testing readers
paulneves77 Nov 15, 2025
4998370
the ND xubpixel binning appears to be working, and made some updates …
paulneves77 Nov 15, 2025
75b0378
corrected errors in qz calculator, cleaned up test_hdf5_reader, impro…
paulneves77 Nov 16, 2025
7b80507
corrected errors in qz calculator, cleaned up test_hdf5_reader, impro…
paulneves77 Nov 16, 2025
a9707fd
started cleaning up for pull request
paulneves77 Nov 17, 2025
c1796c5
fixed temp_hdf5_reader to be slightly more compliant with NXcanSAS st…
paulneves77 Nov 17, 2025
8808d67
fixed apertures and run from none to empty list if missing, and fixed…
paulneves77 Nov 17, 2025
a8826e3
[pre-commit.ci lite] apply automatic fixes for ruff linting errors
pre-commit-ci-lite[bot] Nov 17, 2025
97ef953
cleaned up code based on Jeff Kryzwon's suggestions and added test ca…
paulneves77 Nov 17, 2025
ec99203
removed NDrebin from this branch.
paulneves77 Nov 17, 2025
fde631c
implemented minor cleanups to code
paulneves77 Nov 18, 2025
4b4adad
fixed a few bugs and cleaned up more
paulneves77 Nov 18, 2025
d0915a3
added raw back to metadata
paulneves77 Dec 1, 2025
6c92675
fixed some bugs with importing sasdata/test/sasdataloader/data/simple…
paulneves77 Dec 2, 2025
d76a5bb
fixed the collimation cansas_class attribute in the nxcansas_1Dand2D_…
paulneves77 Dec 2, 2025
b2323bd
removed local path references, removed spurious units.py
paulneves77 Dec 3, 2025
fe7c7cc
moved duplicate code in parse_quantity to a call of parse_float, chan…
paulneves77 Dec 3, 2025
9a5c451
fixed minor error in reference output for nxcansas_1Dand2D_multisasda…
paulneves77 Dec 3, 2025
84d1548
brought over NDrebin from refactor_24_3D branch
paulneves77 Nov 16, 2025
366226e
updated NDrebin a bunch and also added NDrebin testing
paulneves77 Nov 17, 2025
d76264f
[pre-commit.ci lite] apply automatic fixes for ruff linting errors
pre-commit-ci-lite[bot] Nov 17, 2025
35e3819
added note on using NDrebin for M dimensional integration
paulneves77 Nov 17, 2025
7cc5cb8
first pass at rebasing NDrebin to a class
paulneves77 Nov 18, 2025
c1daf88
second pass at cleaning up NDrebin class
paulneves77 Nov 18, 2025
0fa8ff7
NDrebin class ready for testing
paulneves77 Nov 18, 2025
e4ce571
added unit testing for NDrebin
paulneves77 Nov 18, 2025
cec4c67
removed temporary testing from NDrebin.py
paulneves77 Nov 18, 2025
454b044
cleaned up NDrebin, removed old function, added documentation
paulneves77 Nov 18, 2025
c347689
refactor NDRebin._build_limits to pass codescene review. vectorized a…
paulneves77 Dec 1, 2025
bec824e
fixed bug in _build_limits
paulneves77 Dec 1, 2025
0fdb481
indented code block, clarified non-vector comment, fixed typo, remove…
paulneves77 Dec 3, 2025
6b97217
indented code block, clarified non-vector comment, fixed typo, remove…
paulneves77 Dec 3, 2025
f1ed900
Update date format in refactor roadmap
DrPaulSharp Dec 15, 2025
cf5f163
Basic test harness for names
rprospero Jan 20, 2026
afad34a
Base 62 encode the hash for shorter names
rprospero Jan 20, 2026
ebf0a71
Name info in unique id for NamedQuantity
rprospero Jan 20, 2026
80638ec
Ruff formatting
rprospero Jan 20, 2026
fa1c064
Properly attach run title and number to quantity information
rprospero Jan 20, 2026
0aa175a
Make the name a part of all quantities
rprospero Jan 21, 2026
8304bef
Ensure that xml imports also include a proper name unique id
rprospero Jan 21, 2026
582b2d5
Ensure ASCII reader generates unique_id for data quantities
rprospero Jan 21, 2026
837a741
Refactor our id_header
rprospero Jan 21, 2026
2265729
[pre-commit.ci lite] apply automatic fixes for ruff linting errors
pre-commit-ci-lite[bot] Jan 21, 2026
6d6c53e
Minor formatting fixes
rprospero Jan 21, 2026
5f692a1
Remove debugging print statements
rprospero Jan 23, 2026
87abb9a
Refactor operations (#184)
DrPaulSharp Jan 23, 2026
adb4bb1
Update refactor roadmap
DrPaulSharp Feb 6, 2026
9446d8f
Adds trig and exp operations (#186)
DrPaulSharp Feb 17, 2026
bde0c8b
Merge remote-tracking branch 'origin/refactor_24' into refactor_24
krzywon Mar 16, 2026
d5ab81e
Implement ArbitraryUnit class
rprospero Feb 19, 2026
880a6b8
Refactor utest_units.py
rprospero Feb 19, 2026
b4cb726
Add multiplication support for arbitrary units
rprospero Feb 19, 2026
2eebf5c
Add power support for arbitrary units
rprospero Feb 19, 2026
926a305
Refactor arbitrary unit representations
rprospero Feb 19, 2026
c12ac24
Enable arbitrary division
rprospero Feb 19, 2026
5707a2e
Rework display of arbitrary units
rprospero Feb 19, 2026
b9df2ec
Properly reduce terms and add rdiv for arbitrary units
rprospero Feb 19, 2026
416253e
Remove unneeded function stubs
rprospero Feb 20, 2026
86aa707
[pre-commit.ci lite] apply automatic fixes for ruff linting errors
pre-commit-ci-lite[bot] Feb 20, 2026
b4d3df3
Fix windows unicode printing issue in test
rprospero Feb 20, 2026
dae8346
Switch name to UnknownUnit
rprospero Mar 3, 2026
03178cf
Minor format cleanup of _units_base.py
rprospero Mar 3, 2026
02234e2
Check for invalid characters in UnknownUnit
rprospero Mar 3, 2026
caa9c34
Add parentheses around denominator of UnknownUnits
rprospero Mar 3, 2026
6f53423
[pre-commit.ci lite] apply automatic fixes for ruff linting errors
pre-commit-ci-lite[bot] Mar 3, 2026
f25acbe
Simplify division and serialisation of UnknownUnits
rprospero Mar 3, 2026
5d24145
Mypy fixup of sasdata/quantities/units.py
rprospero Mar 6, 2026
59bd2b1
Rename test_unit_names to test_unit_operations
rprospero Mar 9, 2026
fa7b2c3
Add default case for __eq__ in UnknownUnit
rprospero Mar 17, 2026
7f9de96
Fix return types for division of UnknownUnit
rprospero Mar 17, 2026
37e2d7a
Merge pull request #190 from SasView/172_unrecognized_units
krzywon Mar 24, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ venv
tests.log
/.pytest_cache

# Unit test / coverage reports
htmlcov/
.coverage
.cache/

# Installer files
/installers/build
/installers/dist
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ default_install_hook_types: [pre-commit, pre-push]

repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.14.1
rev: v0.12.9
hooks:
# Run the linter, applying any available fixes
- id: ruff-check
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ html5lib

# Other stuff
matplotlib
pre-commit
pre-commit
2 changes: 1 addition & 1 deletion sasdata/ascii_reader_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
T = TypeVar('T')

# TODO: There may be a better place for this.
pairings = {'I': 'dI', 'Q': 'dQ', 'Qx': 'dQx', 'Qy': 'dQy'}
pairings = {'I': 'dI', 'Q': 'dQ', 'Qx': 'dQx', 'Qy': 'dQy', 'Qz': 'dQz'}
pairing_error = {value: key for key, value in pairings.items()}
# Allows this to be bidirectional.
bidirectional_pairings = pairings | pairing_error
Expand Down
3 changes: 3 additions & 0 deletions sasdata/checklist.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Things to check once everything is in place:

1) Do any centigrade fields read in incorrectly?
2 changes: 1 addition & 1 deletion sasdata/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def abscissae(self) -> Quantity:
# TODO: Won't work when there's errors involved. On reflection, we
# probably want to avoid creating a new Quantity but at the moment I
# can't see a way around it.
return Quantity(data_contents, reference_data_content.units)
return Quantity(data_contents, reference_data_content.units, name=self._data_contents["Qx"].name, id_header=self._data_contents["Qx"]._id_header)
case dataset_types.sesans:
return self._data_contents["SpinEchoLength"]
case _:
Expand Down
2 changes: 1 addition & 1 deletion sasdata/data_backing.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def summary(self, indent_amount: int = 0, indent: str = " ") -> str:
s += f"{indent*(indent_amount+1)}{shorten_string(str(self.data))}\n"
for key in self.attributes:
value = self.attributes[key]
if isinstance(value, (Group | Dataset)):
if isinstance(value, (Group, Dataset)):
value_string = value.summary(indent_amount+1, indent)
else:
value_string = f"{indent * (indent_amount+1)}{key}: {shorten_string(repr(value))}\n"
Expand Down
Loading
Loading