-
Notifications
You must be signed in to change notification settings - Fork 4
Sasview database #106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
summerhenson
wants to merge
675
commits into
refactor_24
Choose a base branch
from
sasview-database
base: refactor_24
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Sasview database #106
Changes from all commits
Commits
Show all changes
675 commits
Select commit
Hold shift + click to select a range
1586bcb
Test GET dataset with metadata
summerhenson f166df1
Add comments to serializer classes
summerhenson cb9ab83
Fix serialization of DataSet with files
summerhenson 2003e0e
Check access to files in a dataset
summerhenson 299d236
Test DataSet creation with files
summerhenson ceac365
Filter files in dataset by access
summerhenson 1943f93
Test loading dataset with files
summerhenson 7e86678
Start session tests
summerhenson 36a94ba
Copy session is_public value to composing datasets
summerhenson f90bafa
Test listing sessions
summerhenson 816ef95
Fix bugs in DataSet creation nested in a Session
summerhenson 051cb0f
Include username and authentication status in all post responses
summerhenson 67a58d6
Disallow creating private sessions without an owner
summerhenson a015017
Test Session post method
summerhenson 1ebefe8
Use the right serializer for sessions and return id with get
summerhenson 5d0e25c
Test get method for individual sessions
summerhenson 618a174
Test put method for individual sessions
summerhenson 03a7b20
Test Session delete method
summerhenson 9f2e100
Propagate access changes from session to composing datasets
summerhenson 3f76d39
Test Session access management
summerhenson c5ba40f
Return current_user as username not id
summerhenson 9b7c753
Comments of session testing
summerhenson 1229ab2
Add field for history references to Quantity
summerhenson 9d2e2e7
Serialization for Quantity variable references
summerhenson 2c76297
Change serialization of QuantityHistory references to match API
summerhenson e85c67c
Serialize Quantity operation_tree and references as history
summerhenson a932e52
Remove infinite serialization loop of quantities and histories
summerhenson aa0f88c
Separate model for history reference quantities
summerhenson d778173
Test references in quantity history
summerhenson 9793c62
Add tests to test updating a DataSet
summerhenson 9b6c977
Propagate update to session is_public to datasets
summerhenson 9d0e7b5
PublishedState serialization and minor serializer create method simpl…
summerhenson af2bbcc
Outline of PublishedState views
summerhenson 8d26332
PublishedState list method
summerhenson c253c15
Serializer to restrict PublishedState update to published field
summerhenson a3347cc
Post method for PublishedState
summerhenson bc7c530
Get method for single PublishedState
summerhenson 8725314
Update method for PublishedState
summerhenson e499ea3
Delete method for PublishedState
summerhenson e0ed9c0
Planning for PublishedState testing
summerhenson 45402c4
PublishedState urls
summerhenson 1e1c7b1
Test listing published states
summerhenson c3deba3
Fix bugs in PublishedState creation
summerhenson e1953f5
Check that session doesn't already have a published state
summerhenson d1a9099
Test creating a published state
summerhenson c213f6c
Add fields to PublishedState get response
summerhenson 5a67a81
Test individual PublishedState get method
summerhenson 4888486
Test PublishedState update method
summerhenson 1fb3ef6
Test PublishedState delete method
summerhenson 2055ad7
Session creation example script
summerhenson 9aa8e25
Add models to admin interface
summerhenson 66ef37e
Account for json strings in post requests
summerhenson 636a0aa
Enable session-based authentication
summerhenson b115876
Comments for PublishedState tests
summerhenson 5afd16c
Test that metadata is required for dataset creation
summerhenson 68866a2
Minor changes suggested by Jeff
summerhenson cbe15ef
Nested PublishedState update in Session
summerhenson 426f6d7
Test nested PublishedState
summerhenson d9bc070
Test listing published states by username
summerhenson e00b5d9
Deserialization methods for sasdata structures
summerhenson 5998beb
Data sketch
lucas-wilkins e9a5d2b
Some units
lucas-wilkins 233f383
Work towards outline
lucas-wilkins 529bedc
Units now available and grouped
lucas-wilkins a7a77c5
More units
lucas-wilkins bb489d2
one d in shadow
lucas-wilkins 7619dbc
Fixed density units
lucas-wilkins 96e1f49
Use alias list to remove duplicates
lucas-wilkins f6863a5
More units, towards formatting
lucas-wilkins ebf6aa1
Units and accessors draft ready to begin tests on
lucas-wilkins a82e88d
Some tests
lucas-wilkins 5903d8e
SI unit module
lucas-wilkins 4cc3d2c
si unit list
lucas-wilkins f10d810
More tests, added names
lucas-wilkins 1dc82d7
More units
lucas-wilkins 6966098
Notes
lucas-wilkins c01fbf8
Notes
lucas-wilkins 10eaeac
start of metadata structure
lucas-wilkins 9645fbd
Metadata work, and unit groups
lucas-wilkins 3fac420
More metadata stuff
lucas-wilkins ee6d8a9
Named units in unit groups
lucas-wilkins d276e99
More metadata, added absolute temperature stuff
lucas-wilkins 9599d68
Metadata objects complete for now
lucas-wilkins 1c0c0eb
Percent test and fix
lucas-wilkins 29bed57
Work towards new data object
lucas-wilkins 6b6c97a
Basic reading
lucas-wilkins 3e4fd6b
Work towards structuring inputs with uncertainties
lucas-wilkins 499af49
Work on uncertainty propagation
lucas-wilkins dd9615e
Added some code to enable test driven development.
a19f531
Some minor changes to stop my editor from crying.
727b30e
Pass in the dimensions so this code is correct.
2b06236
Wrote some tests ahead.
e7e7830
Parse using a slant as well.
ad8adda
Found a regex for splitting up the string.
7f9124d
Implemented the parse_single_unit function.
489a326
Use two functions for parsing.
524483f
Use list comprehension to get potential symbols.
9212720
parse unit strs function.
62350f4
Created a function to pass in a stack of units.
de6e4f5
Multiply dimensions function.
e42baf3
Use the new multiply function.
69c2124
Nvm I'm blind; there already was a multiply method.
d42eb27
Parse in a whole unit.
ffb47b1
I still need this multply for parse_unit_stack.
b83fe9d
System for combining units.
02306d7
Removed not implemented comment.
2dc8d87
Parse in a named unit.
43439cd
Avoid mutating state.
cf7b65b
Replace the unit on the stack.
18a5a94
Fixed the logic around combining units.
b5f5c7f
Parse_name_unit can take in an already parsed unit.
2c827fc
Added a todo comment.
cc0477a
Take a unit from the command line.
a4eb3d3
Added whitespace on input.
b1b19d1
Fixed typo.
e1ad375
Only multiply scale by 1, or -1.
5817d5a
Look for slashes in the string.
9450879
Got fraction units working as well :)
60b9587
Configure how ambiguities are dealt with.
1a25256
Only break if we have found a symbol.
a8f2622
Take in longest unit across the whole file.
0c0a8fb
Take in a unit group in parse_singe_unit.
106aa71
Parse a unit from a specific group.
e75fb07
Equivalent function for from group.
c5c6d8a
Is none not equal to none.
350e736
Removed old TODO comment.
8952fe4
Catch key errors.
729825d
Expand the try block.
3b44869
Removed an old todo comment.
7fd7eed
New unit test in pytest.
dae132c
Raise an exception if the unit can't be parsed.
64a877f
Added some unit tests that should error.
9f4c2ba
Created a regex validator for the unit str.
837c285
Throw an exception if the validation fails.
ece9561
Update unit test to reflect new error.
ab18563
Unit test for what I was originally testing for.
218bf09
Added more tests for slants.
368b9e5
Slants should be valid unit strings as well.
0d2c5d9
Parse in newton as its defined value.
5f8b174
Remove the old testing file.
a582638
This function isn't being used.
e51d38c
Added to the doc string about unit groups.
d8009b1
Moved the unit group to first.
76c92ef
Small rename.
baa63cd
Use destructuring to make this a bit cleaner.
91e3b86
Fixed function call.
4196cc6
Added some docstrings.
1c4b2ef
Refactored parse named unit so it just takes one arg.
1b5e73b
Removed old todo comment.
bd7687a
Added some docstrings.
3ecbad9
Stop linter from moaning.
550619f
Accept spaces in the unit str.
d19824b
Split by dots as well.
aad07a8
Work on adding uncertainties, adding non-integer powers
lucas-wilkins 86bd404
Integer unit powers now work
lucas-wilkins c88b808
Quantities now have histories, and variance could work, needs testing…
lucas-wilkins 63b8c41
Quantities ready for testing
lucas-wilkins 2caadc7
Quantity combining seems to work
lucas-wilkins a90a92d
Fixed error in helper function
lucas-wilkins 40b7209
Fixed error formatting bug
lucas-wilkins 7edc510
Tests for error propagation
lucas-wilkins 6a34c4a
More aliases for units
lucas-wilkins fd5a6d5
Made file for target object for metadata
lucas-wilkins b8424c9
Main data reading for HDF5 prototype
lucas-wilkins 2dabda2
integrating the units stuff
lucas-wilkins 6a6f0bd
Parsing of units in HDF5 reader
lucas-wilkins 93bc62a
Fixed moles potentially
lucas-wilkins f615426
Unit name fixes
lucas-wilkins 4af3da3
Filling in some of the working for the accessors
lucas-wilkins d0cf6b1
Fixed bug where ohms, and angstroms were forbidden
bda8b9a
Accept the ^ char but don't do anything with it.
b5c1409
Connecting metadata
lucas-wilkins 297a2ae
Remove target data object attempt
lucas-wilkins 5a2bf05
Accessor changes
lucas-wilkins 74864f0
Merge tidying
lucas-wilkins f6c30d6
Metadata linked up, just not pointing in the right place right now
lucas-wilkins 49e1db1
Added some debugging info to the summary
lucas-wilkins e286cc7
Debugging metadata
lucas-wilkins 8d13974
Better reference methods
lucas-wilkins ec3c459
Added matrix operations, needs tests
lucas-wilkins ecc81b5
Numpy import
lucas-wilkins a86fa70
Added __matmul__ and __rmatmul__ to quantities
lucas-wilkins 5316f79
Entrypoint for rebinning
lucas-wilkins f574609
Some better commenting on Quantity
lucas-wilkins 7681e95
Work towards rebinning methods
lucas-wilkins 1a1fc0c
Zeroth order rebinning sketch
lucas-wilkins 6d54f27
First order rebinning
lucas-wilkins 6ead275
Rebinning tests and extensions
lucas-wilkins 9785da5
Work towards fraction binning
lucas-wilkins 47c08e6
Mesh merging and some refactoring
lucas-wilkins 3e43907
Triangulated mesh
lucas-wilkins 3ac0415
Mesh merging works
lucas-wilkins 67039a8
Implementation of Rebinner base class
lucas-wilkins 5eb1169
Work towards demo
lucas-wilkins b130f4a
Voronoi mesh edges and ordering
lucas-wilkins c821709
It works, needs benchmarking
lucas-wilkins b0fecd7
Much faster assignment/merge method
lucas-wilkins bde9885
Significantly faster edge crossing algorithm
lucas-wilkins 52b5edd
Demo
lucas-wilkins 875818d
Notes
lucas-wilkins ccf9337
No error
lucas-wilkins 5ff8041
Interpolation stuff
lucas-wilkins 5c2ffcb
Moving some things around
lucas-wilkins 59e6913
Move math and operations into quantity
lucas-wilkins f536d4e
Fixes from move
lucas-wilkins a688dd6
Tensor product implementation
lucas-wilkins 0c3071d
Extended transpose, and tensor tests
lucas-wilkins cdc99fe
Encodings for numerical values
lucas-wilkins e58e6f8
Tidying up
lucas-wilkins a702e67
Work on sparse matrix serialisation
lucas-wilkins 25db055
Is anyone capable of putting sensible things in HDF5 files? Correctio…
lucas-wilkins 06910b3
Line endings :)
lucas-wilkins 26a6f9c
Updated final line endings
lucas-wilkins 1df8506
Fix test import
lucas-wilkins bfca9f5
Work on tests for sparse matrix encoding
lucas-wilkins 5ea206c
Fix tests
lucas-wilkins 7b5956a
Disable machine specific mesh test for MacOS
lucas-wilkins 72247b0
Make import paths absolute.
jamescrake-merani bdafc0b
Fix import of _units_base by _build_tables.py
rprospero f6e4e9b
Add latex symbols to units which need them
rprospero 16d5dd9
Started with the basic ascii reader func signature
9763bd8
Fixed import errors.
8759b98
Moving internal metadata to sasdata.
cd6850a
A very basic skeleton of the trend object.
0b757ec
Implemented equality based on the hash.
1baa900
Wrote a test for the trend.
fa771df
Use full function name here.
jamescrake-merani 6a6971e
Add with standard error for quantities.
jamescrake-merani 4e853aa
Wrote a test for 1d data.
jamescrake-merani ebac6a0
Bring guess into sasdata.
0f51347
Bring default logic from SasView here.
747a6ad
Wrote a test for the ASCII reader.
29c5867
Create test option for displaying diagnostic plots
rprospero 19ab285
More interpolation test into main test directory
rprospero cc26e1b
Add tests for dataset
rprospero eaa0595
Parse source
rprospero db349ee
Instrument is a data class
rprospero b093660
Metadata is a dataclass
rprospero 029b02f
Start adding official tests for xml file loading
rprospero d34c74a
Better work at handling comments
rprospero a4d58d3
More tests of xml
rprospero b7bd79b
Mark weird units, but continue parsing
rprospero 8b130c3
Add last xml test
rprospero 554ca72
Fix parsing of BeamSize
rprospero 796e65e
Skeleton framework for SESANS data
rprospero 1f6dae0
Multiple SESANS files in reader test
rprospero 79c973f
SESANS metadata as a process, not an aperture
rprospero 87ca591
More tests for quantities
rprospero 1c4aacc
Applies auto fixes for ruff rule F401
DrPaulSharp b6c0eae
[pre-commit.ci lite] apply automatic fixes for ruff linting errors
pre-commit-ci-lite[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| name: Tests | ||
|
|
||
| on: | ||
| [push, pull_request] | ||
|
|
||
| defaults: | ||
| run: | ||
| shell: bash | ||
|
|
||
| jobs: | ||
| unit-test: | ||
|
|
||
| runs-on: ${{ matrix.os }} | ||
| strategy: | ||
| matrix: | ||
| os: [macos-latest, ubuntu-latest, windows-latest] | ||
| python-version: ['3.12'] | ||
| fail-fast: false | ||
|
|
||
| steps: | ||
|
|
||
| - name: Obtain SasData source from git | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Python ${{ matrix.python-version }} | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
| cache: 'pip' | ||
| cache-dependency-path: | | ||
| **/test.yml | ||
| **/requirements*.txt | ||
|
|
||
| ### Installation of build-dependencies | ||
|
|
||
| - name: Install Python dependencies | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| python -m pip install wheel setuptools | ||
| python -m pip install -r requirements.txt | ||
| python -m pip install -r sasdata/fair_database/requirements.txt | ||
|
|
||
| ### Build and test sasdata | ||
|
|
||
| - name: Build sasdata | ||
| run: | | ||
| # BUILD SASDATA | ||
| python -m pip install -e . | ||
|
|
||
| ### Build documentation (if enabled) | ||
|
|
||
| - name: Test with Django tests | ||
| run: | | ||
| python sasdata/fair_database/manage.py test sasdata.fair_database |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,19 @@ | ||
| default_install_hook_types: [pre-commit, pre-push] | ||
|
|
||
| repos: | ||
| - repo: https://github.com/astral-sh/ruff-pre-commit | ||
| rev: v0.12.9 | ||
| hooks: | ||
| # Run the linter, applying any available fixes | ||
| - id: ruff-check | ||
| stages: [ pre-commit, pre-push ] | ||
| args: [ --fix-only ] | ||
| - repo: https://github.com/pre-commit/pre-commit-hooks | ||
| rev: v5.0.0 | ||
| hooks: | ||
| - id: trailing-whitespace | ||
| files: "sasdata/fair_database/.*" | ||
| - repo: https://github.com/astral-sh/ruff-pre-commit | ||
| rev: v0.9.2 | ||
| hooks: | ||
| - id: ruff | ||
| args: [--fix, --exit-non-zero-on-fix] | ||
| files: "sasdata/fair_database/.*" | ||
| - id: ruff-format | ||
| files: "sasdata/fair_database/.*" | ||
| - repo: https://github.com/codespell-project/codespell | ||
| rev: v2.3.0 | ||
| hooks: | ||
| - id: codespell | ||
| files: "sasdata/fair_database/.*" | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,4 +16,3 @@ html5lib | |
|
|
||
| # Other stuff | ||
| matplotlib | ||
| pre-commit | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Relevant discussion: https://github.com/orgs/SasView/discussions/3171