Skip to content
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

Molar to mass conversions #1492

Open
pchelle opened this issue Oct 24, 2024 · 0 comments
Open

Molar to mass conversions #1492

pchelle opened this issue Oct 24, 2024 · 0 comments
Labels
type: bug Something isn't working

Comments

@pchelle
Copy link
Contributor

pchelle commented Oct 24, 2024

For Concentration, AUC and Amount/Mass conversion works as expected.
But nor for other dimensions that could use molar weight.

library(ospsuite)
#> Loading required package: rSharp

toUnit(
  quantityOrDimension = "Amount",
  values = 1,
  targetUnit = "mg",
  sourceUnit = "mmol",
  molWeight = 1
)
#> [1] 1e+09

toUnit(
  quantityOrDimension = "Amount per time",
  values = 1,
  targetUnit = "mg/s",
  sourceUnit = "mmol/s",
  molWeight = 1
)
#> Error in do.call(".External", c(list("r_call_method", self$pointer, methodName), : Type:    OSPSuite.Utility.Exceptions.OSPSuiteException
#> Message: Unit 'mg/s' is not defined in dimension 'Amount per time'.
#> Method:  Double[] convertToUnit(OSPSuite.Core.Domain.UnitSystem.IDimension, System.String, System.Nullable`1[System.Double], Double[])
#> Stack trace:
#>    at OSPSuite.R.Services.DimensionTask.convertToUnit(IDimension dimension, String targetUnit, Nullable`1 molWeight, Double[] valuesInBaseUnit)
#>    at OSPSuite.R.Services.DimensionTask.ConvertToUnit(String dimensionName, String targetUnit, Double valueInBaseUnit, Double molWeight)
#>    at InvokeStub_DimensionTask.ConvertToUnit(Object, Span`1)
#>    at System.Reflection.MethodBaseInvoker.InvokeWithFewArgs(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)

Created on 2024-10-24 with reprex v2.1.0

@pchelle pchelle added the type: bug Something isn't working label Oct 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant