Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds create-config entry point #758

Merged
merged 8 commits into from
Jan 4, 2024
Merged

Adds create-config entry point #758

merged 8 commits into from
Jan 4, 2024

Conversation

ns-rse
Copy link
Collaborator

@ns-rse ns-rse commented Dec 13, 2023

Closes #757

Adds a topostats create-config entry point and removes reference to run_topostats.

As we move towards a new release having a modular interface is desirable and that includes generation of sample configuration files. This commit brings the "swiss army knife" approach of topostats <subcommand>to parity with the older run_topostats by adding topostats create-config to generate configuration files for users to edit.

Documentation has been updated to reflect these changes, including the README.md. Because we have versioned documentation users will still be able to refer to the older documentation.

For now the run_topostats method remains but raises a deprecation warning (UserWarning) if the --create-config-file option is used.

Future Extension

Currently TopoStats is designed to work primarily with nucelic acid samples and in most cases the topostats/default_config.yaml which serves as a basis for generating configuration samples is a good starting point.

However, there are other types of samples that may be scanned, silicone, large molecular structures such as proteins, prokaryotic and eukaryotic cells. These might require a different set of default parameters.

With this in mind I have implemented what I hope is a method for provisioning such configurations once sensible defaults have been determined. This would work via the topostats create-config --config <sample_type> option and for each <sample_type> there would be a topostats/<sample_type>_config.yaml in the TopoStats repository/package from which the resulting output would be derived.

To this end a check is made whether the specified configuration is available and it fails telling the user that no such config is available if incorrectly specified. An appropriate test has been added to the test suite to cover this.

NB This work was undertaken as a consequence of re-writing the .github/ISSUE_TEMPLATES/ so that the instructions could use this new entry point (see #759 ).

@ns-rse ns-rse added the ui Issues relating to User Interface label Dec 13, 2023
Copy link

codecov bot commented Dec 13, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (3adbc6c) 84.25% compared to head (b6986b7) 84.32%.
Report is 14 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #758      +/-   ##
==========================================
+ Coverage   84.25%   84.32%   +0.07%     
==========================================
  Files          21       21              
  Lines        3105     3119      +14     
==========================================
+ Hits         2616     2630      +14     
  Misses        489      489              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ns-rse ns-rse force-pushed the ns-rse/757-create-config branch from a9de1ed to 46092fc Compare December 13, 2023 22:05
Closes #757

Adds a `topostats create-config` entry point and removes reference to `run_topostats`.

As we move towards a new release having a modular interface is desirable and that includes generation of sample
configuration files. This commit brings the "swiss army knife" approach of `topostats <subcommand>`to parity with the
older `run_topostats` by adding `topostats create-config` to generate configuration files for users to edit.

Documentation has been updated to reflect these changes, including the `README.md`. Because we have versioned
documentation users will still be able to refer to the older documentation.

For now the `run_topostats` method remains but raises a deprecation warning if the `--create-config-file` option is used.

**NB** This work was undertaken as a consequence of re-writing the `.github/ISSUE_TEMPLATES/` so that the instructions
could use this new entry point (see separate Pull Request).
@ns-rse ns-rse force-pushed the ns-rse/757-create-config branch from 46092fc to c9926ef Compare December 13, 2023 22:22
This branch/PR adds a new sub-process for creating configuration files and so we no longer need the option to `topostats
process` to `--create-config_file`. For now the functionality remains in place in `topostats/run_topostats.py` so that
the legacy entry point will run.

+ Added a small amount to the `docs/usage.md` file to indicate how to find out what options are possible to the
  `topostats process` sub-command and `topostats create-config` sub-command.
+ In the flag names that are used we had a mixture of `-` and `_` separating words these are now all consistent (and use
  `-`)
+ Added another parameter to one of the tests, just for fun!
Only had `-c` as an option, adds a longer form flag.
Seems its not possible to partially remove this option so I've removed it completely, we should be encouraging users to
adopt to the new set of entry points.
@ns-rse
Copy link
Collaborator Author

ns-rse commented Dec 19, 2023

I've addressed #761, once this PR is approved and merged I'll add that in (trying to stay focused and avoid drift on PRs and keep it to small chunks of work).

@ns-rse ns-rse merged commit 0cb7bf9 into main Jan 4, 2024
13 checks passed
@ns-rse ns-rse deleted the ns-rse/757-create-config branch January 4, 2024 08:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ui Issues relating to User Interface
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Entry point to create-config
2 participants