-
Notifications
You must be signed in to change notification settings - Fork 1
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 #18
Open
williamjameshandley
wants to merge
38
commits into
master
Choose a base branch
from
unimpeded_database
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…unction called get for quick loading of datasets.
… class takes in a file path.
…or uploading chains on my macbook locally.
…t can download csv files from Zenodo, given filename and ID.
…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.
… Need to test it on Github.
…o unimpeded_database
…o unimpeded_database
…hub secrets access token
…g the github access token with ACCESS_TOKEN = os.getenv(ACCESS_TOKEN).
… unittests.yaml, changed back to original version.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #18 +/- ##
============================================
- 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. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Created a class called database, for uploading and downloading chains from local device or the HPC to zenodo. This is a copy of #17, but from the main repository, not a fork.
Checklist:
flake8 unimpeded tests
)pydocstyle --convention=numpy unimpeded
)python -m pytest
)