Skip to content

Commit

Permalink
Merge pull request #9 from MetaSys-LISBP/dev
Browse files Browse the repository at this point in the history
v2.0.3
  • Loading branch information
llegregam authored May 17, 2022
2 parents 636f583 + d4f48d3 commit a8c67c2
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 23 deletions.
7 changes: 2 additions & 5 deletions docs/faq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,11 @@ What units should be used for input data?
------------------------------

Input data (biomass concentration, metabolites concentrations, and time) can be provided to PhysioFit using any unit. Still, we recommand to use units for which values are as close to unity as
possible to ensure numerical stability (e.g. 3 mM instead of 3e3 µM). Importantly, units of the estimated fluxes depend on units of time and metabolites and biomass concentrations.
possible to ensure numerical stability (e.g. 3 mM instead of 3e3 µM). Importantly, units of the estimated fluxes depend on units of time and metabolites and biomass concentrations. The concentration of different metabolites can
be provided using different units, but a single unit must be used for all measurements of a given metabolite.

.. seealso:: :ref:`flux units`

To avoid any numerical instabilities, provide values in a range not too far from unity (e.g. if a metabolite
concentration is 2 mM, provide the value directly in mM and not as 2e-3 M). The concentration of different metabolites can
be provided using different units, but a single unit must be used for all measurements of a given metabolite.

.. _`flux units`:

What are the flux units?
Expand Down
2 changes: 1 addition & 1 deletion physiofit/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "2.0.2"
__version__ = "2.0.3"
4 changes: 2 additions & 2 deletions physiofit/base/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,15 @@ def _read_data(path_to_data: str) -> DataFrame:

data_path = Path(path_to_data).resolve()

if data_path.suffix == ".tsv":
if data_path.suffix in [".txt", ".tsv"]:
data = read_csv(str(data_path), sep="\t")
elif data_path.suffix == ".csv":
data = read_csv(str(data_path), sep=";")
else:
if not data_path.exists():
raise ValueError(f"{data_path} is not a valid file")
else:
raise TypeError(f"{data_path} is not a valid format. Accepted formats are .csv or .tsv")
raise TypeError(f"{data_path} is not a valid format. Accepted formats are .csv, .txt or .tsv")

IoHandler._verify_data(data)
return data
Expand Down
2 changes: 1 addition & 1 deletion physiofit/ui/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def parse_args():
parser = argparse.ArgumentParser("Physiofit: Extracellular flux estimation software")

# Parse data arguments (tsv + json)
parser.add_argument("-t", "--data", type=str, help="Path to data file in tsv format")
parser.add_argument("-t", "--data", type=str, help="Path to data file in tabulated format (txt or tsv)")
parser.add_argument("-c", "--config", type=str, help="Path to config file in json format")

# Parse basic parameters
Expand Down
6 changes: 3 additions & 3 deletions physiofit/ui/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def _initialize_opt_menu(self):
if file_extension == "json":
config = IoHandler.read_json_config(self.data_file)
input_values.update(config)
elif file_extension != "tsv":
elif file_extension not in ["tsv", "txt"]:
raise KeyError(
f"Wrong input file format. Accepted formats are tsv for data files or json for configuration "
f"files. Detected file: {self.data_file.name}")
Expand All @@ -94,7 +94,7 @@ def _initialize_opt_menu(self):
submitted = self._initialize_opt_menu_widgets(input_values, file_extension)

if submitted:
if file_extension == "tsv":
if file_extension in ["tsv", "txt"]:
self.io_handler.data = data
self.io_handler.data = self.io_handler.data.sort_values("time", ignore_index=True)
self.io_handler.names = self.io_handler.data.columns[1:].to_list()
Expand Down Expand Up @@ -145,7 +145,7 @@ def _initialize_opt_menu_widgets(self, input_values, file_extension):
disabled=enable_mc
)

if file_extension == "tsv":
if file_extension in ["tsv", "txt"]:

# Set up tkinter for directory chooser
root = tk.Tk()
Expand Down
10 changes: 6 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
pandas
matplotlib
numpy
scipy
pandas >= 1.1.5
numpy >= 1.21.6
scipy >= 1.5.2
streamlit>=1.8.0
matplotlib >= 3.5.1
openpyxl >= 3.0.9
14 changes: 7 additions & 7 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ classifiers =

[options]
packages = find:
python_requires = >=3.6
python_requires = >=3.7
install_requires =
pandas
numpy
scipy
streamlit>=1.5.0
matplotlib
openpyxl
pandas >= 1.1.5
numpy >= 1.21.6
scipy >= 1.5.2
streamlit>=1.8.0
matplotlib >= 3.5.1
openpyxl >= 3.0.9

[options.entry_points]
console_scripts =
Expand Down

0 comments on commit a8c67c2

Please sign in to comment.