Skip to content

Commit

Permalink
Merge pull request #30 from MetaSys-LISBP/dev
Browse files Browse the repository at this point in the history
bump to 3.0.4
  • Loading branch information
llegregam authored May 12, 2023
2 parents ecabc48 + 0ca4321 commit 860acad
Show file tree
Hide file tree
Showing 10 changed files with 155 additions and 26 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ physiofit.egg-info/PKG-INFO
physiofit.egg-info/requires.txt
physiofit.egg-info/SOURCES.txt
physiofit.egg-info/top_level.txt
/data/KEIO_test_data/KEIO_ROBOT6_1/KEIO_ROBOT6_1_res/
/versions publi/
17 changes: 0 additions & 17 deletions data/KEIO_test_data/KEIO_ROBOT6_1/KEIO_ROBOT6_1.tsv

This file was deleted.

File renamed without changes.
11 changes: 6 additions & 5 deletions physiofit/base/fitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -468,11 +468,12 @@ def khi2_test(self):
)

logger.info(f"khi2 test results:\n"
f"khi2 value: {cost}\n"
f"Number of measurements: {number_measurements}\n"
f"Number of parameters to fit: {number_params}\n"
f"Degrees of freedom: {dof}\n"
f"p-value = {p_val}\n")
f"khi2 value: {cost}\n"
f"Number of measurements: {number_measurements}\n"
f"Number of parameters to fit: {number_params}\n"
f"Degrees of freedom: {dof}\n"
f"p-value = {p_val}\n"
)

if p_val < 0.95:
logger.info(
Expand Down
17 changes: 17 additions & 0 deletions physiofit/data/data_example.tsv
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
time X Glc Ace
1.7 6.2E-2 NA NA
2.3 8.6E-2 NA NA
2.7 0.11 NA NA
3.4 0.17 NA NA
3.8 0.21 NA NA
4.2 0.3 NA NA
4.6 0.38 NA NA
5 0.55 NA NA
5.4 0.61 NA NA
1.4 NA 13.63 0.22
1.9 NA 13.58 0.37
2.9 NA 12.62 0.71
4 NA 11.25 1.46
4.8 NA 9.37 2.14
5.2 NA 8.20 2.55
5.6 NA 6.55 2.89
30 changes: 30 additions & 0 deletions physiofit/tests/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@

"""
Configuration variables for the tests
Shared pre-defined parameters
The return value of fixture function will be available as a predefined
parameter for all test functions. The test's parameter name must be the same as
the fixture function's name.
"""

import pytest
from physiofit.base.io import IoHandler
from physiofit.models.base_model import StandardDevs

@pytest.fixture
def data():
"""Test data to use in tests"""

return IoHandler.read_data(
r"C:\Users\legregam\PycharmProjects\PhysioFit\physiofit\data\data_example.tsv"
)

@pytest.fixture
def sds():
return StandardDevs(
X = 0.2,
Glc = 0.5,
Ace = 0.5
)

28 changes: 28 additions & 0 deletions physiofit/tests/test_fitter.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
"""
Test the creation and use of the PhysioFitter
"""

import pytest
import physiofit as phyfit
from pandas import read_csv


def test_physiofitter(data, sds):
"""
Test that the model and PhysioFitter can be safely instanciated from IoHandler
"""

io = phyfit.base.io.IoHandler()
model = io.select_model("Steady-state batch model", data)
assert isinstance(model, phyfit.models.base_model.Model)
model.get_params()
fitter = io.initialize_fitter(
model.data,
model=model,
sd=sds,
debug_mode=True
)
assert isinstance(fitter, phyfit.base.fitter.PhysioFitter)

def test_simulation(data, sds):
pass
2 changes: 1 addition & 1 deletion physiofit/ui/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def _initialize_opt_menu(self):
if not self.io.home_path:
raise ValueError("No output directory selected")
self.config_parser = ConfigParser(
path_to_data =self.io.home_path / self.data_file.name,
path_to_data = self.io.home_path / self.data_file.name,
selected_model= self.model,
sds = self.sd,
mc = self.mc,
Expand Down
68 changes: 67 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "physiofit"
version = "3.0.2"
version = "3.0.4"
description = "Calculate extracellular fluxes from metabolite concentrations and biomass data"
authors = ["llegregam <[email protected]>"]
license = "GNU General Public License (GPL)"
Expand All @@ -27,6 +27,10 @@ Sphinx = "^6.1.3"
sphinx-argparse = "^0.4.0"
sphinx-rtd-theme = "^1.2.0"


[tool.poetry.group.test.dependencies]
pytest = "^7.3.1"

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

0 comments on commit 860acad

Please sign in to comment.