Skip to content

1.0.0.a3

Pre-release
Pre-release

Choose a tag to compare

@rmnldwg rmnldwg released this 15 Nov 08:23
· 160 commits to main since this release
4069220

What's New

This is (again) a fairly substantial rewrite of the scripts. They now use pydantic for configuration management. This allows multiple YAML files to be merged with command line arguments and also implements exceptional data validation. Also, we now use joblib to cache intermediate results. This also allows for effortless caching when the functions are used as a library instead of a CLI.

What's now left to do is tidy up everything, read through the docs and then publish a proper 1.0.0 release.

Bug Fixes

  • (plot) Turn off label by passing None.
  • (plot) Don't fail on wrong wrong in .draw().
  • Polish dataclass configuration.
  • Make pydantic work with subparsers.
  • (data) Correct argument name of save function.
  • (comp) Add distributions & fix dir type for priors.
  • (config) Don't thin samples twice.

Documentation

  • (configs) Add to sphinx docs.
  • Add intersphinx link to lydata.
  • (config) Improve construct_model docstring.
  • Correct copyright year.
  • Clean up refs to deleted modules.
  • Fix links to documentation in readme.

Features

  • (config) Write new methods to assemble model.
  • (plot) Add func split_legends(). Related [#60].
    This allows the user to separate many plot's labels into a number of
    different legends.
  • (configs) Add graph config.
  • (sample) Better config management.
    The new sample command can merge configurations from multiple YAML files
    as well as the command line. It does a better job at reporting progress
    when the log-level is set to debug and it more consistently stores
    samples and metric logs during burn-in.
  • (sample) Add JSON schema for params.
    With this JSON schema one can get auto-completion in most popular
    code editors for the configs of most commands.
  • (config) Allow loading external model.
    It is now possible to not only specify a model using a fixed YAML
    schema, but also via a plain Python file that defines a global model
    variable.
  • (sample) Add inverse temperature.
    With this addition, it is now in principle possible to do thermodynamic
    integration. But it is not yet fully fleshed out for a nice user
    experience.
  • Add tiny script to generate JSON schema.
    The script creates a JSON schema based on all CLI commands' settings.
  • (comp) Rewrite posteriors command that uses pydantic and joblib
  • (comp) Rewrite risks command that uses pydantic and joblib
  • (sample) Add iterations/second column to burnin progress display.
  • (sample) Show total iterations to sampling progress display.
  • (config) Allow converting diagnosis to involvement.
  • (compute) Rewrite prevalence command that uses pydantic and joblib

Miscellaneous Tasks

  • Bump pre-commit hooks.
  • Add ruff linting rules.
  • Switch to ruff, drop pycln & isort.
  • Run ruff & clean up codebase.
  • Ignore some ruff rules in tests dir.

Styling

  • More cleanup to satisfy ruff.
  • Improve docstrings and code style a bit.

Testing

  • Add some basic testing for config.
  • (data) Basic integration test for generate.
  • Add sampling step to integration tests.
  • (config) Check the external loading feature.
  • Extend & unify integration test for priors.

Build

  • Remove upper cap in dependencies.
  • Bump lymph-model to 1.2.3.
  • Remove dev from optional dependencies.
    This is because a lot of dev tools like ruff, pre-commit, ... are
    installed globally (e.g. with pipx) instead of per venv.
  • Bump lydata dependency to 0.2.0.

Change

  • (plot) Improve beta post & hist. Fixes [60].
    The histograms and beta posteriors are now better implemented, allowing
    a user to extend the draw() function's abilities by adding classes
    similar to Histogram and BetaPosterior.
  • (plot) More flexible labels.
  • Use pydantic over dacite.
  • Switch to pydantic config for sampling (WIP).
  • (compute) Use pydantic & joblib over dataclasses and custom caching.
  • BREAKING (compute) Add priors joblib cache
  • BREAKING (data) Replace the generate cmd.
    This was just supposed to be a little script to generate data for an
    integration test, but it turns out that it could just be used to update
    the old generate command.
    BREAKING CHANGES: generate command is better configurable
  • (config) Merge sample/sampling configs.
  • Use lydata's ModalityConfig.
    Since the lydata package is
    evolving quickly, I added it as a dependency and moved the first bit of
    code over there.
  • Enable use of lydata to load patient data.
  • (comp) HDF5 file storage more versatile.
  • (sample) Store history in .tmp file.
    This serves an indication about whether or not a burn-in sampling round
    has been interrupted. The sampler may then continue from where it left off.
  • BREAKING (compute) Update prevalence computation.
  • More useful YAML load/merge logging.
  • Improve logging of some utilities.

Remove

  • Outdated streamlit app.
  • Temporary test file.
  • Delete remaining streamlit code.
  • BREAKING Unused HDF5 cache and scenarios.
    Both these things are superseded by better stuff based on pydantic.