8000 ci(actions): Fixing GitHub Actions and refactoring API by pesap · Pull Request #7 · NREL/plexosdb · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

ci(actions): Fixing GitHub Actions and refactoring API #7

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

Merged
merged 14 commits into from
Aug 13, 2024
Merged

Conversation

pesap
Copy link
Collaborator
@pesap pesap commented Aug 10, 2024

Summary

  • Restructure the code to match the name of the CollectionEnum, ClassEnum and to take them as arguments instead of passing the name,
  • Added high-level API wrappers for _add_memberships and _get_id
  • There is now a new high-level API for get
  • New method to check if an ID exist that replaces having to add exceptions when trying to insert new stuff to the database,
  • Added example dummy XML,
  • mypy compliant

New functionality

New methods for for interacting with database

  • get_object_id,
  • get_category_id
  • get_membership_id
  • get_property_id
  • get_collection_id
  • check_id_exists

We can now have fine-control on what test to run. For example, to test all the getter functions we can use:

python -m pytest -vvl -m get_functions

Available marks:

  • get_functions,
  • add_functions,
  • empty_database (not currently working unless you add a master_file

Additional changes

  • Updated CI workflows to include latest version of setup-python,
  • Added new jobs that will run in parallel: pre-commit, mypy and ruff,
  • Fixed mypy version so that both pre-commit and mypy job matches,
  • Added useful markers for testing: get_functions, add_functions and empty_database,
  • Removed IntEnum in favor of using the name for matching the class names,
  • Renamed CollectionEnums to match the name of the collection

Coverage

Name Stmts Miss Cover Missing
src/plexosdb/__init__.py 2 0 100%
src/plexosdb/enums.py 100 1 99% 121
src/plexosdb/exceptions.py 8 0 100%
src/plexosdb/sqlite.py 347 12 97% 94, 143, 311, 465, 857, 909, 945, 954, 1014-1015, 1142-1143
src/plexosdb/utils.py 27 1 96% 35
src/plexosdb/xml_handler.py 118 10 92% 110, 124-126, 162, 193-194, 218, 228, 256
TOTAL 602 24 96%

@pesap pesap requested a review from ktehranchi August 13, 2024 05:08
@pesap pesap changed the title ci(actions): Fixing action ci(actions): Fixing GitHub Actions and refactoring API Aug 13, 2024
Copy link
Collaborator
@ktehranchi ktehranchi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.... Definitely more functions to maintain with this route, but it will make the code more interpretable and easier to use.

@pesap pesap merged commit d701510 into main Aug 13, 2024
7 checks passed
@pesap pesap deleted the ps/actions branch August 13, 2024 18:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0