Skip to content

Commit

Permalink
Merge branch 'main' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
dweindl committed Sep 18, 2023
2 parents 9a0592e + 9f22a6d commit 2c44efe
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 4 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,19 @@

## 0.2 series

### 0.2.4

* Made figure sizes for visualization functions customizable via `petab.visualize.plotting.DEFAULT_FIGSIZE`
by @dweindl in https://github.com/PEtab-dev/libpetab-python/pull/222
* Fixed Handling missing `nominalValue` in `Problem.get_x_nominal`
by @dweindl in https://github.com/PEtab-dev/libpetab-python/pull/223
* Fixed pandas 2.1.0 `FutureWarnings`
by @dweindl in https://github.com/PEtab-dev/libpetab-python/pull/226
* Added pre-commit-config, ran black, isort, ...
by @dweindl in https://github.com/PEtab-dev/libpetab-python/pull/225

**Full Changelog**: https://github.com/PEtab-dev/libpetab-python/compare/v0.2.3...v0.2.4

### 0.2.3

* Fixed validation failures in case of missing optional fields in visualization tables
Expand Down
2 changes: 1 addition & 1 deletion doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
# -- Project information -----------------------------------------------------

project = "libpetab-python"
copyright = "2018, the PEtab developers"
copyright = "2018-2023, the PEtab developers"
author = "PEtab developers"

# The full version, including alpha/beta/rc tags
Expand Down
14 changes: 12 additions & 2 deletions petab/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,25 @@ def write_simulation_df(df: pd.DataFrame, filename: Union[str, Path]) -> None:
df.to_csv(filename, sep="\t", index=False)


def get_visualization_df(visualization_file: Union[str, Path]) -> pd.DataFrame:
def get_visualization_df(
visualization_file: Union[str, Path, pd.DataFrame, None]
) -> Union[pd.DataFrame, None]:
"""Read PEtab visualization table
Arguments:
visualization_file: URL or filename of PEtab visualization table
visualization_file:
URL or filename of PEtab visualization table to read from,
or a DataFrame or None that will be returned as is.
Returns:
Visualization DataFrame
"""
if visualization_file is None:
return None

if isinstance(visualization_file, pd.DataFrame):
return visualization_file

try:
types = {PLOT_NAME: str}
vis_spec = pd.read_csv(
Expand Down
2 changes: 1 addition & 1 deletion petab/version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
"""PEtab library version"""
__version__ = "0.2.3"
__version__ = "0.2.4"

0 comments on commit 2c44efe

Please sign in to comment.