Commit e24275c8 authored by anand jain's avatar anand jain
Browse files

rm unitpart

parent 8ce374a2
...@@ -12,6 +12,6 @@ include("utils.jl") ...@@ -12,6 +12,6 @@ include("utils.jl")
sbml = (sym::Symbol) -> dlsym(SBML_jll.libsbml_handle, sym) sbml = (sym::Symbol) -> dlsym(SBML_jll.libsbml_handle, sym)
export SBMLVersion, export SBMLVersion,
readSBML, UnitPart, getS, getLBs, getUBs, getOCs readSBML, getS, getLBs, getUBs, getOCs
end # module end # module
...@@ -157,14 +157,14 @@ function extractModel(mdl::VPtr)::SBML.Model ...@@ -157,14 +157,14 @@ function extractModel(mdl::VPtr)::SBML.Model
end end
# parse out the unit definitions # parse out the unit definitions
units = Dict{String,Vector{UnitPart}}() units = Dict{String,Vector{SBML.UnitPart}}()
for i = 1:ccall(sbml(:Model_getNumUnitDefinitions), Cuint, (VPtr,), mdl) for i = 1:ccall(sbml(:Model_getNumUnitDefinitions), Cuint, (VPtr,), mdl)
ud = ccall(sbml(:Model_getUnitDefinition), VPtr, (VPtr, Cuint), mdl, i - 1) ud = ccall(sbml(:Model_getUnitDefinition), VPtr, (VPtr, Cuint), mdl, i - 1)
id = get_string(ud, :UnitDefinition_getId) id = get_string(ud, :UnitDefinition_getId)
units[id] = [ units[id] = [
begin begin
u = ccall(sbml(:UnitDefinition_getUnit), VPtr, (VPtr, Cuint), ud, j - 1) u = ccall(sbml(:UnitDefinition_getUnit), VPtr, (VPtr, Cuint), ud, j - 1)
UnitPart( SBML.UnitPart(
unsafe_string( unsafe_string(
ccall( ccall(
sbml(:UnitKind_toString), sbml(:UnitKind_toString),
......
...@@ -11,7 +11,7 @@ const Maybe{X} = Union{Nothing,X} ...@@ -11,7 +11,7 @@ const Maybe{X} = Union{Nothing,X}
Part of a measurement unit definition that corresponds to the SBML definition Part of a measurement unit definition that corresponds to the SBML definition
of `Unit`. For example, the unit "per square megahour", Mh^(-2), is written as: of `Unit`. For example, the unit "per square megahour", Mh^(-2), is written as:
UnitPart("second", # base SI unit, this says we are measuring time SBML.UnitPart("second", # base SI unit, this says we are measuring time
-2, # exponent, says "per square" -2, # exponent, says "per square"
6, # log-10 scale of the unit, says "mega" 6, # log-10 scale of the unit, says "mega"
1/3600) # second-to-hour multiplier 1/3600) # second-to-hour multiplier
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment