Skip to content

Commit

Permalink
Release 0.1.11
Browse files Browse the repository at this point in the history
  • Loading branch information
dilpath authored Feb 1, 2024
2 parents 316b437 + 7169cd3 commit beaf300
Show file tree
Hide file tree
Showing 35 changed files with 830 additions and 627 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@ name: CI
# trigger
on:
push:
branches:
- main
pull_request:
branches:
- main
schedule:
# run Tuesday and Friday at 02:00 UTC
- cron: '00 2 * * TUE,FRI'
workflow_dispatch:
merge_group:

jobs:
base:
Expand Down
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@

repos:
- repo: https://github.com/psf/black
rev: 22.6.0
rev: 23.10.0
hooks:
- id: black
description: The uncompromising code formatter
- repo: https://github.com/pycqa/isort
rev: 5.10.1
rev: 5.12.0
hooks:
- id: isort
name: isort (python)
Expand All @@ -21,14 +21,14 @@ repos:
name: isort (pyi)
types: [pyi]
- repo: https://github.com/nbQA-dev/nbQA
rev: 1.3.1
rev: 1.7.0
hooks:
- id: nbqa-black
- id: nbqa-pyupgrade
args: [--py36-plus]
- id: nbqa-isort
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
rev: v4.5.0
hooks:
- id: check-yaml
description: Check yaml files for parseable syntax
Expand Down
27 changes: 27 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# .readthedocs.yml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Build documentation in the docs/ directory with Sphinx
sphinx:
builder: html
configuration: doc/conf.py
fail_on_warning: True

python:
install:
- method: pip
path: .
extra_requirements:
- doc

build:
os: "ubuntu-22.04"
apt_packages:
- libatlas-base-dev
- swig
tools:
python: "3.11"
180 changes: 124 additions & 56 deletions README.md

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions changes.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Changes

## 0.1.11
- fixed bug in stepwise moves when working with multiple subspaces (#65)
- fixed bug in FAMoS switching (#68)
- removed `BidirectionalCandidateSpace` and `ForwardAndBackwardCandidateSpace` (#68)
- set estimated parameters as the nominal values in exported PEtab problems (#77)
- many CI, doc, and code quality improvements by @dweindl (#57, #58, #59, #60, #61, #63, #69, #70, #71, #72, #74)
- fixed bug in model hash reproducibility (#78)
- refactored `governing_method` out of `CandidateSpace` (#73)
- fixed bug related to attempted calibration of virtual models (#75)

## 0.1.10
- added `Model.set_estimated_parameters`
- now expected that `Model.estimated_parameters` has untransformed values
Expand Down
2 changes: 2 additions & 0 deletions doc/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
_build
generated
20 changes: 20 additions & 0 deletions doc/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
BUILDDIR = _build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
20 changes: 20 additions & 0 deletions doc/api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
petab-select Python API
=======================

.. rubric:: Modules

.. autosummary::
:toctree: generated

petab_select
petab_select.candidate_space
petab_select.constants
petab_select.criteria
petab_select.handlers
petab_select.misc
petab_select.model
petab_select.model_space
petab_select.model_subspace
petab_select.petab
petab_select.problem
petab_select.ui
76 changes: 76 additions & 0 deletions doc/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# Configuration file for the Sphinx documentation builder.
#
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

import inspect

# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information

project = 'petab-select'
copyright = '2023, The PEtab Select developers'
author = 'The PEtab Select developers'

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

extensions = [
"readthedocs_ext.readthedocs",
"sphinx.ext.napoleon",
"sphinx.ext.autodoc",
"sphinx.ext.intersphinx",
"sphinx.ext.autosummary",
"sphinx.ext.viewcode",
"sphinx.ext.mathjax",
"nbsphinx",
"IPython.sphinxext.ipython_console_highlighting",
"recommonmark",
"sphinx_autodoc_typehints",
]

templates_path = ['_templates']
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']


intersphinx_mapping = {
"petab": (
"https://petab.readthedocs.io/projects/libpetab-python/en/latest/",
None,
),
"pandas": ("https://pandas.pydata.org/docs/", None),
"numpy": ("https://numpy.org/devdocs/", None),
"python": ("https://docs.python.org/3", None),
}

autosummary_generate = True
autodoc_default_options = {
"special-members": "__init__",
"inherited-members": True,
}


# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output

html_theme = 'sphinx_rtd_theme'
# html_static_path = ['_static']


def autodoc_skip_member(app, what, name, obj, skip, options):
"""Exclude some objects from the documentation."""
if inspect.isbuiltin(obj):
return True

# Skip inherited members from builtins
# (skips, for example, all the int/str-derived methods of enums
if (
objclass := getattr(obj, "__objclass__", None)
) and objclass.__module__ == "builtins":
return True

return None


def setup(app: "sphinx.application.Sphinx"):
app.connect("autodoc-skip-member", autodoc_skip_member, priority=0)
11 changes: 11 additions & 0 deletions doc/examples.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Examples
========

Various example notebooks.

.. toctree::
:maxdepth: 1

examples/example_cli_famos.ipynb
examples/workflow_cli.ipynb
examples/workflow_python.ipynb
6 changes: 4 additions & 2 deletions doc/examples/example_cli_famos_helpers.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from pathlib import Path
from typing import Tuple
from typing import List, Tuple

import pandas as pd

Expand Down Expand Up @@ -47,7 +47,9 @@ def calibrate(
)


def parse_summary_to_progress_list(summary_tsv: str) -> Tuple[Method, set]:
def parse_summary_to_progress_list(
summary_tsv: str,
) -> List[Tuple[Method, set]]:
"""Get progress information from the summary file."""
df_raw = pd.read_csv(summary_tsv, sep='\t')
df = df_raw.loc[~pd.isnull(df_raw["predecessor change"])]
Expand Down
22 changes: 22 additions & 0 deletions doc/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
.. petab-select documentation master file, created by
sphinx-quickstart on Mon Oct 23 09:01:31 2023.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to petab-select's documentation!
========================================

.. toctree::
:maxdepth: 2
:caption: Contents:

examples
api


Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
35 changes: 35 additions & 0 deletions doc/make.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=.
set BUILDDIR=_build

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.https://www.sphinx-doc.org/
exit /b 1
)

if "%1" == "" goto help

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%

:end
popd
8 changes: 8 additions & 0 deletions petab_select/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"""Model selection extension for PEtab."""

import sys

from .candidate_space import *
from .constants import *
from .criteria import *
Expand All @@ -9,3 +11,9 @@
from .model_subspace import *
from .problem import *
from .ui import *

__all__ = [
x
for x in dir(sys.modules[__name__])
if not x.startswith('_') and x != 'sys'
]
Loading

0 comments on commit beaf300

Please sign in to comment.