-
Notifications
You must be signed in to change notification settings - Fork 3
Refactoring Branch #79
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
base: master
Are you sure you want to change the base?
Conversation
sasdata/quantities/_units_base.py
Outdated
| si_scaling_factor: float, | ||
| dimensions: Dimensions): | ||
|
|
||
| self.scale = si_scaling_factor |
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.
Is there any reason not to call self.scale self.si_scaling_factor as well?
sasdata/quantities/units.py
Outdated
|
|
||
|
|
||
| # | ||
| # Units by type |
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.
While writing the unit tests for my parser, I had a thought. I think the unit groups should perhaps go into a separate module. To import a unit, we would do
from sasdata.quantities.units import meters. meters_per_second ...'Which makes sense. But to import a unit group, the import statement would look like this.
from sasdata.quantities.units import speed, acceleration ...'Which might be a little confusing because we're importing a unit group from the units module. Its a fairly minor change but having a separate unit group module might make this clearer.
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.
Yeah, sounds like a good plan
a16b0a6 to
e27d0cc
Compare
6e3ba34 to
c010919
Compare
4ac9584 to
d4683bd
Compare
* Start documenting design descisions * Roadmap * Updated details on roadmap * Update refactor_roadmap.rst * Refactors filename --------- Co-authored-by: Paul Sharp <[email protected]>
* Added a test case data class. * Use float not quantity for value. * Add first test case. * Early test function for each individual item. * Default value for ascii reader params. * Changed ordering to make Python happy. * Fixed case when there are no params. * Use the full path to load a file. * Grab file from the data directory. * Get the first data loaded as well. * Get the specific quantity to check based on index. * Expect this test to fail. * Brought over another test case. * Handle some uncertainties. * Removed unused import. * Converted over the 2D test. * Don't blanket xfail everything. * Use reason keyword. * Different approach to the test case class. Use abstract base class with inheritance. * Use the new test case class. * Make a data load function to reduce repetition. * Use the new local data load function. * Convert to use the new classes. * Move these function defs to the top. * Fix this load function. * If there is expected metadata, see if its there. * Added Mumag test case. * Give this a default value. * Expected metadata is no longer nullable. It could be empty, but it should always have a value. * Default value needs to be default factory. * Accept filenames in dict for bulk. * Create a separate class for bulk ascii test cases. * Formatting. * Only take in params for bulk. Saves time, as I don't think a str list would be used. * Updated comment. * Handle bulk data checking. * This doesn't need to be an abc. * Make these kw_only. To avoid problems with inheritance. * Temporarily disable this test. Need to make sure there aren't any regressions in the other tests first. * Different type hint for bulk in expected metadata. * Convert to bulk ascii test. * Move bulk ascii case to the top of match. So that it matches with that first. * If nothing matches, don't add it. * Use the ascii loader with params we already have. * Should be continue not return. * Check for metadata properly. * Add a case for XML data. Not really anything special here. * Case for HDF5. * Use filename for XML as well. * Added mumag data as ttest files * Remove unused import. * Added an XML test case. * Ruff format. * Use the local load function. * Get the first item in the dictionary. * Handle these uncertainties. * Add other uncertainties. So that the old todo comment is rectified. * Added a test case for an HDF5 file. * Mark this test as xfail. * Remove the old tests. * [pre-commit.ci lite] apply automatic fixes for ruff linting errors * Remove duplicate line. * These ds shouldn't be here. * Ruff formats. * Added a function to test for an uncertainty column. * Use the new is_uncertainty function. * Restores sasdataload tests from refactor_24 --------- Co-authored-by: James Crake-Merani <[email protected]> Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com> Co-authored-by: PaulSharp <[email protected]>
d4683bd to
3df6e01
Compare
Main branch for the refactoring project