-
Notifications
You must be signed in to change notification settings - Fork 1
fixing errors deling with offsets in unit definitions #354
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
Merged
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
b6c4a05
fixing errors deling with offsets in unit definitions
MauriceHendrix cfabac8
release notes
MauriceHendrix 27b489e
added warnings for offset units
MauriceHendrix b6ae4ec
ignore offset of 0 without warning
MauriceHendrix 8f291f0
ValueError nstead for non-0 offset units
MauriceHendrix 6fa9ee8
Update RELEASE.md
MichaelClerx 34e9d26
Update dimensionless_offset.cellml
MauriceHendrix b7337c5
Update test_offset.cellml
MauriceHendrix eedf60a
Update test_offset_0.cellml
MauriceHendrix 89d7ecd
Update tests/cellml_files/test_offset.cellml
MauriceHendrix 6ac80c9
Update test_offset.cellml
MauriceHendrix 854d948
fixing dimensionless conversion accprding to michael's comments
MauriceHendrix 95a5108
remove unneeded extra test
MauriceHendrix df29f1f
Merge branch 'master' into offset_error
MauriceHendrix 6d1d7e2
Update cellmlmanip/units.py
MauriceHendrix 83bb0b5
Merge branch 'master' into offset_error
MauriceHendrix 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
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
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,19 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <!-- CellML Test Suite. https://github.com/MichaelClerx/cellml-validation --> | ||
| <!-- CellML 1.0, 5.2.7: The exponent of dimensionless doesn't matter --> | ||
| <model name="unit_conversion_prefix" | ||
| xmlns="http://www.cellml.org/cellml/1.0#"> | ||
| <units name="hyper_dimensionless"> | ||
| <unit units="dimensionless" exponent="12" /> | ||
| </units> | ||
| <component name="A"> | ||
| <variable name="x" units="dimensionless" initial_value="3" public_interface="out" /> | ||
| </component> | ||
| <component name="B"> | ||
| <variable name="y" units="hyper_dimensionless" public_interface="in" /> | ||
| </component> | ||
| <connection> | ||
| <map_components component_1="A" component_2="B" /> | ||
| <map_variables variable_1="x" variable_2="y" /> | ||
| </connection> | ||
| </model> |
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,18 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <!-- Testing dimensionless unit with multiplier --> | ||
| <model name="unit_conversion_dimensionless_multiplier_1" | ||
| xmlns="http://www.cellml.org/cellml/1.0#"> | ||
| <units name="halves"> | ||
| <unit units="dimensionless" multiplier="0.5" /> | ||
| </units> | ||
| <component name="A"> | ||
| <variable name="x" units="dimensionless" initial_value="1" public_interface="out" /> | ||
| </component> | ||
| <component name="B"> | ||
| <variable name="y" units="halves" public_interface="in" /> | ||
| </component> | ||
| <connection> | ||
| <map_components component_1="A" component_2="B" /> | ||
| <map_variables variable_1="x" variable_2="y" /> | ||
| </connection> | ||
| </model> |
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,8 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <!-- Testing more dimensionless unit with multiplier --> | ||
| <model name="unit_conversion_dimensionless_multiplier_1" | ||
| xmlns="http://www.cellml.org/cellml/1.0#"> | ||
| <units name="half_meter"> | ||
| <unit units="meter" multiplier="0.5" /> | ||
| </units> | ||
| </model> |
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,18 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <!-- Testing dimensionless unit with offset --> | ||
| <model name="unit_conversion_dimensionless_offset" | ||
| xmlns="http://www.cellml.org/cellml/1.0#"> | ||
| <units name="biggers"> | ||
| <unit units="dimensionless" offset="-1" /> | ||
| </units> | ||
| <component name="A"> | ||
| <variable name="x" units="dimensionless" initial_value="3" public_interface="out" /> | ||
| </component> | ||
| <component name="B"> | ||
| <variable name="y" units="biggers" public_interface="in" /> | ||
| </component> | ||
| <connection> | ||
| <map_components component_1="A" component_2="B" /> | ||
| <map_variables variable_1="x" variable_2="y" /> | ||
| </connection> | ||
| </model> |
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,11 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <!-- cellmlmanip test: error should be raised if non-zero offset is used --> | ||
| <model name="unit_conversion_dimensionless_offset" | ||
| xmlns="http://www.cellml.org/cellml/1.0#"> | ||
| <units name="offsetmeter"> | ||
| <unit units="meter" offset="10" /> | ||
| </units> | ||
| <component name="A"> | ||
| <variable name="x" units="offsetmeter" initial_value="3" public_interface="out" /> | ||
| </component> | ||
| </model> |
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,18 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <!-- cellmlmaniptest: offset of 0 is ignored: does not affect parsing or unit equivalence when connections are made --> | ||
| <model name="unit_conversion_dimensionless_offset" | ||
| xmlns="http://www.cellml.org/cellml/1.0#"> | ||
| <units name="offsetmeter"> | ||
| <unit units="meter" offset=" 0 " /> | ||
| </units> | ||
| <component name="A"> | ||
| <variable name="x" units="meter" initial_value="3" public_interface="out" /> | ||
| </component> | ||
| <component name="B"> | ||
| <variable name="y" units="offsetmeter" public_interface="in" /> | ||
| </component> | ||
| <connection> | ||
| <map_components component_1="A" component_2="B" /> | ||
| <map_variables variable_1="x" variable_2="y" /> | ||
| </connection> | ||
| </model> | ||
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
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.
This is good, because it also tests the automatic conversion!