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

Documentation and CLI for backend selection #112

Merged
merged 7 commits into from
Mar 7, 2024
Merged

Conversation

RMeli
Copy link
Owner

@RMeli RMeli commented Mar 7, 2024

Description

Close #108 and close #109.

This PR adds documentation related to #107:

  • Add doc to README
  • Add doc to tutorial (website)
  • Add docstrings to functions (unfortunately they don't appear in the API documentation since they are private)

This PR adds the -g/--graph-backend to manually select a backend from CLI.

Additionally, the following cleanup is done:

  • Use importlib.utils to check if a package is available, without importing it
  • Re-work how internal alias dictionaries are constructed
  • Make backend test more general, in preparation to Add rustworkx backend #111

Checklist

  • Tests
  • Documentation
  • Changelog

Copy link

codecov bot commented Mar 7, 2024

Codecov Report

Merging #112 (d5911ed) into develop (0b917f8) will decrease coverage by 0.02%.
The diff coverage is 100.00%.

Additional details and impacted files

@RMeli
Copy link
Owner Author

RMeli commented Mar 7, 2024

@Jnelen, would you be able to review this PR? It's a follow up to your PR #107, so your insight would be very much appreciated!

spyrmsd/__main__.py Outdated Show resolved Hide resolved
@Jnelen
Copy link
Contributor

Jnelen commented Mar 7, 2024

I quickly skimmed through everything. Great clean-ups and changes!
LGTM! Maybe this is even worth a bump in version number? Especially if you add the new rust-based backend!

@RMeli
Copy link
Owner Author

RMeli commented Mar 7, 2024

Thank you so much for having a look @Jnelen, much appreciated!

Maybe this is even worth a bump in version number? Especially if you add the new rust-based backend!

Yes, 100%. I wanted to add rx and eventually cleanup CI. But your PR definitely warrant a new release ASAP!

@Jnelen
Copy link
Contributor

Jnelen commented Mar 7, 2024

Thank you so much for having a look @Jnelen, much appreciated!

Maybe this is even worth a bump in version number? Especially if you add the new rust-based backend!

Yes, 100%. I wanted to add rx and eventually cleanup CI. But your PR definitely warrant a new release ASAP!

Always glad to be of help! Don't hesitate to reach out to me for any future PRs where you think I could lend a hand!

README.md Show resolved Hide resolved
@RMeli RMeli merged commit fbff4a3 into develop Mar 7, 2024
63 checks passed
@RMeli
Copy link
Owner Author

RMeli commented Mar 7, 2024

Thanks for the review/help @Jnelen!

@Jnelen
Copy link
Contributor

Jnelen commented Mar 7, 2024

Thanks for the review/help @Jnelen!

Glad to be of help!

@RMeli RMeli deleted the backend-doc-cli branch April 5, 2024 20:44
RMeli added a commit that referenced this pull request Apr 5, 2024
* add details on NotImplementedError exceptions

* changelog

* remove versioneer

* changelog

* fix warning

* fix tests with pytest 8

* update changelog

* update ci

* add setuptools for python 12

* setuptools in ci

* use miniconda, conda is missing from macos-14

* miniforge

* fixes

* mamba

* bump min python version

* update changelog

* Update build system to flit_core

* Add entry to changelog

* Update CHANGELOG.md

* Delete .gitattributes

* Delete .lgtm.yml

* Update CHANGELOG.md

* Add functionality to select backend (#107)

* Documentation and CLI for backend selection (#112)

* Add rustworkx backend (#111)

* Update graph.py to support set_backend function
I also made a fuction to see the available backends and get the current backend

* Apply private _available_backends suggestions from code review

This commit contains the suggested changes regarding making the available_backends variable private, and refactoring the get_available_backends method to available_backends

Co-authored-by: Rocco Meli <r.meli@bluemail.ch>

* Print warning when backend is already set + make sure we use _available_backends everywhere where possible

* remove reliance on environment variables

* make _validate_backend function
print warning when a certain backend isn't installed

* Use precommit hooks
add __all__ back
refactor _alias_backendDict to _alias_to_backend

* Update ValueError message

Co-authored-by: Rocco Meli <r.meli@bluemail.ch>

* Don't return the backend when setting it

Co-authored-by: Rocco Meli <r.meli@bluemail.ch>

* Add dummy function to make mypy happy
remove __all__ assignment

* fist play with rustworkx backend

* add documentation for backend selection

* add cli backend selection

* cleanup

* changelog

* apply @Jnelen suggestion and add warning filter

* make molecule test also more robust

* add rx to ci

* add rustworkx to all backends tests

* add back graphtool

* add rx to test all backends and add verbose mode

* Update test_molecule.py

---------

Co-authored-by: jnelen <jnelen@ucam.edu>
Co-authored-by: Jochem Nelen <78348388+Jnelen@users.noreply.github.com>

* Update .readthedocs.yml (#114)

* Update .readthedocs.yml

* rm duplicate key

* prepare release 0.7.0

---------

Co-authored-by: Thomas Kluyver <takowl@gmail.com>
Co-authored-by: Jochem Nelen <78348388+Jnelen@users.noreply.github.com>
Co-authored-by: jnelen <jnelen@ucam.edu>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Document backend selection functionality Add backend selection to CLI
2 participants