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

unimpeded_database #17

Open
wants to merge 37 commits into
base: master
Choose a base branch
from
Open

Conversation

DilyOng
Copy link
Collaborator

@DilyOng DilyOng commented Jul 2, 2024

Description

Created a class called database, for uploading and downloading chains from local device or the HPC to zenodo.

Fixes # (issue)

Checklist:

  • I have performed a self-review of my own code
  • My code is PEP8 compliant (flake8 unimpeded tests)
  • My code contains compliant docstrings (pydocstyle --convention=numpy unimpeded)
  • New and existing unit tests pass locally with my changes (python -m pytest)
  • I have added tests that prove my fix is effective or that my feature works
  • I have appropriately incremented the semantic version number in both README.rst and unimpeded/_version.py

Copy link

codecov bot commented Nov 8, 2024

Codecov Report

Attention: Patch coverage is 12.87726% with 433 lines in your changes missing coverage. Please review.

Project coverage is 13.05%. Comparing base (4ea841d) to head (266066f).

Files with missing lines Patch % Lines
unimpeded/database.py 22.41% 218 Missing ⚠️
unimpeded/database_4.py 0.00% 86 Missing ⚠️
unimpeded/database_3.py 0.00% 66 Missing ⚠️
unimpeded/database_2.py 0.00% 56 Missing ⚠️
unimpeded/unimpeded.py 0.00% 7 Missing ⚠️

❗ There is a different number of reports uploaded between BASE (4ea841d) and HEAD (266066f). Click for more details.

HEAD has 131 uploads less than BASE
Flag BASE (4ea841d) HEAD (266066f)
132 1
Additional details and impacted files
@@             Coverage Diff              @@
##            master      #17       +/-   ##
============================================
- Coverage   100.00%   13.05%   -86.95%     
============================================
  Files            2        7        +5     
  Lines            2      498      +496     
============================================
+ Hits             2       65       +63     
- Misses           0      433      +433     

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

DilyOng and others added 20 commits November 14, 2024 13:57
…an new empty deposit on zenodo and returns its deposit_id and bucket_url; added the unimpeded.database.get_metadata() function for creating a metadata readable for Zenodo; created an update_metadata() function which takes in the metadata from get_metadata() and upload/update it to a specific deposit, identified by the given deposit_id; updated the unimpeded.database.upload() function so now it takes in the deposit_id and retrieve the bucket_url and upload the given file.
… raises a requests.exceptions.HTTPError exception, specifying which line and which function went wrong. Good for future debugging; dropped the bucket_url because it isn't needed except in the upload() function, where it can be retrieved locally within the function; added a get_description() function to generate the description in the metadata; added the retrieve_records() function for getting the deposit_id of a published deposit
…mpeded.database.newversion() for creating a new version of an already published Zenodo deposit. It returns the new deposit_id, which is currently not stored and cannot be found using the search description methods (currently called retrieve_records()) before publishing the new deposit. Updated the retrieve_records() function, so now it returns 1) the deposit_id that matches the description if only one deposit is found, 2) by default the latest deposit's id if more than one deposit has identical description and 3) a full list of deposit ids of deposits which share the same description, when return_latest is set to False.
…o unimpeded_database

Added the following line to the unittests.yaml to hide the ACCESS_TOKEN using Github secrets:
env:
          ACCESS_TOKEN: ${{ secrets.ZENODO_SANDBOX_TOKEN }}
…using sandbox or not by setting sandbox = True or False when initiating class database, the code will automatically pick the correct urls.
…all deposit IDs that match the given description, including unpublished deposits,

        and separates them into published and unpublished categories, 2) a function under construction for deleting deposits given the deposit_id (integer or a list), now it only works for unpublished deposit, but cannot delete published deposit.
@williamjameshandley williamjameshandley mentioned this pull request Jan 17, 2025
6 tasks
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