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

Resource class overhaul #236

Merged
merged 16 commits into from Mar 30, 2021
Merged

Resource class overhaul #236

merged 16 commits into from Mar 30, 2021

Conversation

munrojm
Copy link
Member

@munrojm munrojm commented Mar 29, 2021

This PR overhauls the the way resources are handled in the API. Specifically:

  • Abstract base Resource class has been added
  • Generic GetResource class added for standard GET endpoints
  • Generic ConsumerPostResource class added for write-specific endpoints that handle consumer/user data
  • Generic _post_resource method added to core client class to handle post requests

Additionally, a consumer settings endpoint has been added to allow writing consumer settings data.

@codecov-io
Copy link

codecov-io commented Mar 29, 2021

Codecov Report

Merging #236 (882b3cd) into main (8554ac1) will decrease coverage by 1.59%.
The diff coverage is 0.00%.

Impacted file tree graph

@@           Coverage Diff            @@
##            main    #236      +/-   ##
========================================
- Coverage   3.00%   1.41%   -1.60%     
========================================
  Files        109     108       -1     
  Lines       3127    3119       -8     
========================================
- Hits          94      44      -50     
- Misses      3033    3075      +42     
Impacted Files Coverage Δ
src/mp_api/bandstructure/resources.py 0.00% <0.00%> (ø)
src/mp_api/charge_density/resources.py 0.00% <0.00%> (ø)
src/mp_api/core/api.py 0.00% <0.00%> (ø)
src/mp_api/core/client.py 0.00% <0.00%> (ø)
src/mp_api/core/query_operator.py 0.00% <0.00%> (ø)
src/mp_api/core/resource.py 0.00% <0.00%> (ø)
src/mp_api/dielectric/resources.py 0.00% <0.00%> (ø)
src/mp_api/dois/resources.py 0.00% <0.00%> (ø)
src/mp_api/dos/resources.py 0.00% <0.00%> (ø)
src/mp_api/elasticity/resources.py 0.00% <0.00%> (ø)
... and 23 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8554ac1...882b3cd. Read the comment docs.

@munrojm munrojm merged commit f63376a into main Mar 30, 2021
@munrojm munrojm deleted the resource_overhaul branch March 30, 2021 19:48
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.

None yet

2 participants