virtualcell / vcell

Virtual Cell Framework
http://vcell.org/
Other
67 stars 20 forks source link

Handle data type of SED-ML results consistently #92

Closed jonrkarr closed 3 years ago

jonrkarr commented 3 years ago

This is the reason for the failure in biosimulators/Biosimulators#403

Here VCell is converting the data to a numpy array and setting the dtype to float64. https://github.com/virtualcell/vcell/blob/9afe44f074116dcf9c8693691ae1d83944a16356/vcell-cli-utils/vcell_cli_utils/cli.py#L217

In other places, the VCell code isn't doing this conversion. The dtype needs to consistently be set to a numerical type (e.g., float64 for results of continuous simulation, int64 for discrete simulations).

Specifically, what needs to be done is to convert each pandas data frame (results of pandas.read_csv) to a numpy.array (i.e. call pandas.DataFrame.to_numpy()). I don't think the dtype argument needs to be provided. The default dtype should be fine.

jonrkarr commented 3 years ago

I think errors aren't raised earlier because the HDF5 library has some ability to work with pandas.

jonrkarr commented 3 years ago

This is the same as #82 I posted in July.

danv61 commented 3 years ago

Hi Jonathan, I'm trying to locate some omex archive for my testing, most of what I needed I found in https://github.com/biosimulators/Biosimulators_test_suite/tree/dev/examples/sbml-core, but I'm unable to find the following: results_report.SimulatorGeneratesReportsOfSimulationResults sedml.SimulatorProducesLinear2DPlots sedml.SimulatorProducesLogarithmic2DPlots sedml.SimulatorProducesMultiplePlots Can you please help? Thanks!

jonrkarr commented 3 years ago

The test cases are generated dynamically from the COMBINE archives in https://github.com/biosimulators/Biosimulators_test_suite/tree/dev/examples/sbml-core.

This repo provides a command-line program which runs the tests which generate these COMBINE archives dynamically. The command-line program can be used to run individual tests, as well as export the generated archives for inspection. There's information about how to run the command-line program at https://docs.biosimulators.org/Biosimulators_test_suite/tutorial.html#saving-the-synthetic-combine-archives-generated-by-the-test-cases

These command-line options may be helpful:

jonrkarr commented 3 years ago

I'm adding a check for good NumPy data types in biosimulators-utils 0.1.121.

moraru commented 3 years ago

I'm adding a check for good NumPy data types in biosimulators-utils 0.1.121.

thanks! I merged your PR to update the requirements

jonrkarr commented 3 years ago

The change I made doesn't fix the problem. It just adds an earlier and more informative error message.

moraru commented 3 years ago

of course :)

danv61 commented 3 years ago

Fixed in vcell git commit a9fa4a0