-
Notifications
You must be signed in to change notification settings - Fork 5
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
Move Units children of Component to Model element. #8
Open
hsorby
wants to merge
12
commits into
cellml:main
Choose a base branch
from
hsorby:main
base: main
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.
Open
Changes from 4 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
91a92ae
Add a basic model with namespaces on MathML cn elements.
hsorby 675bb8d
Move units that are children of components into the model element.
hsorby 172b7dc
Add example Van der Pol model with units as a child of a component.
hsorby 7c02254
Add new line to end of basic model.
hsorby 5e7c466
Add .gitignore file and ignore tmp/ directory.
hsorby 283821b
Add van der Pol model with Units defined in a Component.
hsorby fde1a48
Merge branch 'master' of github.com:cellml/cellml1to2 into main
hsorby b4973e4
Merge branch 'cn-units-namespace' into main
hsorby 6d033e9
Remove duplicated test-models/van_der_pol_model_1928.txt model.
hsorby 3753dc6
Copy over name attribute of Units when moving from Component to Model.
hsorby 9f8f519
Add a simple testing regime using libCellML, Python, and saxon.
hsorby a263309
Simplify test_model.py script.
hsorby 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 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 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,16 @@ | ||
<model xmlns="http://www.cellml.org/cellml/1.1#" xmlns:cellml="http://www.cellml.org/cellml/1.1#" xmlns:xlink="http://www.w3.org/1999/xlink" name="basic_model" id="metaid0"> | ||
<component name="environment"> | ||
<variable id="environment.t" initial_value="0" name="t" units="second"/> | ||
<math xmlns="http://www.w3.org/1998/Math/MathML"> | ||
<apply> | ||
<eq/> | ||
<ci>t</ci> | ||
<apply> | ||
<plus/> | ||
<cn xmlns:cellml="http://www.cellml.org/cellml/1.1#" cellml:units="dimensionless">1</cn> | ||
<cn xmlns:cellml="http://www.cellml.org/cellml/1.1#" cellml:units="dimensionless">3</cn> | ||
</apply> | ||
</apply> | ||
</math> | ||
</component> | ||
</model> |
This file contains 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,61 @@ | ||
<?xml version='1.0'?> | ||
<model name="van_der_pol_model_1928" xmlns="http://www.cellml.org/cellml/1.0#" xmlns:cellml="http://www.cellml.org/cellml/1.0#"> | ||
<component name="main"> | ||
<units name="per_second"> | ||
<unit exponent="-1" units="second"/> | ||
</units> | ||
<variable name="time" units="second"/> | ||
<variable initial_value="-2" name="x" units="dimensionless"/> | ||
<variable initial_value="0" name="y" units="dimensionless"/> | ||
<variable initial_value="1" name="epsilon" units="dimensionless"/> | ||
<math xmlns="http://www.w3.org/1998/Math/MathML"> | ||
<apply> | ||
<eq/> | ||
<apply> | ||
<diff/> | ||
<bvar> | ||
<ci>time</ci> | ||
</bvar> | ||
<ci>x</ci> | ||
</apply> | ||
<apply> | ||
<times/> | ||
<ci>y</ci> | ||
<cn cellml:units="per_second">1</cn> | ||
</apply> | ||
</apply> | ||
<apply> | ||
<eq/> | ||
<apply> | ||
<diff/> | ||
<bvar> | ||
<ci>time</ci> | ||
</bvar> | ||
<ci>y</ci> | ||
</apply> | ||
<apply> | ||
<times/> | ||
<apply> | ||
<minus/> | ||
<apply> | ||
<times/> | ||
<ci>epsilon</ci> | ||
<apply> | ||
<minus/> | ||
<cn cellml:units="dimensionless">1</cn> | ||
<apply> | ||
<power/> | ||
<ci>x</ci> | ||
<cn cellml:units="dimensionless">2</cn> | ||
</apply> | ||
</apply> | ||
<ci>y</ci> | ||
</apply> | ||
<ci>x</ci> | ||
</apply> | ||
<cn cellml:units="per_second">1</cn> | ||
</apply> | ||
</apply> | ||
</math> | ||
</component> | ||
</model> |
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.
I think this will result in attributes on the
units
elements being ignored, since the template for@*
above does nothing. Have you checked this?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.
You're correct, now I have added a copy command to copy the name attribute. Testing with the van der pol model seems to give the correct result now.