-
Notifications
You must be signed in to change notification settings - Fork 10
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
Litre are recognized #617
Litre are recognized #617
Conversation
|
||
public IDimension TryGetDimensionCaseInsensitive(string dimensionName) | ||
{ | ||
var dimension = Dimensions.FirstOrDefault(d => d.Name.Equals(dimensionName, StringComparison.OrdinalIgnoreCase)); | ||
return dimension ?? NoDimension; | ||
} | ||
|
||
public IDimension TryGetDimensionCaseInsensitiveFromUnit(string unitName) | ||
{ | ||
var dimension = Dimensions.FirstOrDefault(d => d.FindUnit(unitName, true) != null); |
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 is the method DimensionForUnit that does exactly that...
return dimension; | ||
if (_sbmlUnitsSynonyms.ContainsKey(unitName)) | ||
{ | ||
dimension = Dimensions.FirstOrDefault(d => d.Units.Any(u => u.Name.Equals(_sbmlUnitsSynonyms[unitName], StringComparison.OrdinalIgnoreCase))); |
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.
Why not use the DimensionForUnit method here as well?
msv.StartValue = _unitDefinitionImporter.ToMobiBaseUnit(sbmlUnit, new[] { sbmlSpecies.getInitialConcentration() })[0]; | ||
var startValue = _unitDefinitionImporter.ToMobiBaseUnit(sbmlUnit, new[] { sbmlSpecies.getInitialConcentration() })[0]; | ||
msv.StartValue = startValue; | ||
msv.Formula = new ConstantFormula(startValue); |
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.
ConstantFormula should be created using the formulaFactory and dimension needs to be set
@@ -92,4 +92,20 @@ public void SpeciesSameNameDiffCompartmentsTest() | |||
mbb.Any(molecule => molecule.Name == "abc").ShouldBeTrue(); | |||
} | |||
} | |||
|
|||
public class WhenSettingMoleculeStartValue : ContextForSBMLIntegration<SpeciesImporter> |
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.
When_setting_molecule_start_value
Fixes #616 (Litre are recognized as a unit when importing sbml files)