-
Notifications
You must be signed in to change notification settings - Fork 39
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
Data licence addition #257
Conversation
Adds support for adding an optional licence to the add_additional_resource function in additional resource objects
Adds a function to add licence information to the Table class
Adds a test for the new add_data_licence function in the Table class
Fixed incorrect docstring type added to the AdditionalResourceMixin object
Completes and updates the test_add_additional_resource test.
Completes implementation of incomplete test_copy_files function
Adds validation of licence additions to the add_additional_resource function for AdditionalResource objects.
Updates error check in TestTable.test_copy_files
Adds a test to check licence validation in TestTable.add_additional_resource.
Updates the usage documentation in USAGE.rst to include adding licences to additional resource and table objects.
* Use spelling "license" rather than "licence" consistently. * Rename argument "license" as "resource_license" to avoid pylint issue. * Rename Table "license" as "data_license" and write to YAML. * Check that "resource_license" is a dict and correct mandatory keys.
* Not supported by JSON schema or HEPData web application.
* Modify "Getting_started.ipynb" to add license information. * Also print out submission.yaml and YAML data file at end of notebook.
* Fix incorrect use of isinstance added in 919a5ca. * Add a test for resource_license not a dictionary to increase coverage. * Suppress empty "related_records" and "related_to_table_dois" keys.
# Conflicts: # examples/Getting_started.ipynb
This PR is intended to close #245. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #257 +/- ##
==========================================
+ Coverage 89.78% 90.37% +0.58%
==========================================
Files 5 5
Lines 1087 1112 +25
Branches 242 251 +9
==========================================
+ Hits 976 1005 +29
+ Misses 80 78 -2
+ Partials 31 29 -2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
I just noticed the coverage. Sorry, will look into that this week. |
@clelange : when testing Jordan's branch, I noticed that hepdata_lib/hepdata_lib/__init__.py Lines 509 to 517 in ab8bbef
and writes it as hepdata_lib/hepdata_lib/__init__.py Line 613 in ab8bbef
This has been the behaviour ever since the first Therefore, I removed the writing of a default license in commit 2cf9046. We could revert that commit if you disagree with the removal. However, I think it will be confusing if we provide new methods to write license information for data tables and additional resources, but keep a redundant default license for the whole submission that will just be ignored when uploading to HEPData. |
@GraemeWatt - I think there should be a default license that is applied, and I agree that this should be CC0 since that's the default stated on the HEPData web page. I don't remember why we chose CC BY 4.0 back then. As part of this PR, I think it would be good to state in the documentation that this license is applied by default and that this is the default for all HEPData records as well as mentioning that users can change to their own license (with the newly added functionality of this PR). |
Updates test data in TestTable.test_write_yaml to test missed lines.
Looks like the CI has started failing when building a wheel for |
I opened a PR #260 that removes the pin on Pylint and fixes the build, so better to wait for that PR to be merged. |
Updates test_create_files function in test_submission.py to cover missing lines
Fixed some issues output by pylint in the actions output
Updates usage documentation to note default licence
Fixes pylint error around use of open() for files
Updates the documentation for usage in usage.rst to improve licence notice clarity. Now mentions that a licence does not need to be specified if it is CC0.
Removes duplicate reference for `CC0` URL in usage.rst.
Looks like this is now good to go? @ItIsJordan |
Should be ready now, yes! @clelange |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left two comments for discussion that I think are important.
* A license will usually not be needed, so remove for clarity.
This reverts commit 2cf9046.
* Written in the first document of the submission.yaml file, although it is not supported by the JSON schema or the HEPData web application.
add_additional_resource()
function.add_data_license()
function to theTable
class.get_license()
function from CC BY 4.0 to CC0.📚 Documentation preview 📚: https://hepdata-lib--257.org.readthedocs.build/en/257/