-
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
Added support for FAIR4RS metrics #478
Added support for FAIR4RS metrics #478
Conversation
Synchronise with base repo
This reverts commit 850ad34.
def setLicenseDataAndOutput(self): | ||
self.license_info = [] | ||
specified_licenses = self.fuji.metadata_merged.get("license") | ||
if specified_licenses is None: # try GitHub data |
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 think here it has to be tested first if a FRSM metric is used
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.
Good call, I'll add that. Just a note, I've also been thinking about merging the github_data
dictionary into the merged_metadata
but had to focus on other aspects first - might want to consider this further down the line though.
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.
Added in 732b48e.
@@ -60,6 +60,7 @@ def flip_dict(dict_to_flip): | |||
"right_holder": {"label": "License", "sameAs": "http://purl.org/dc/terms/rightsHolder"}, | |||
"object_size": {"label": "Object Size", "sameAs": "http://purl.org/dc/terms/extent"}, | |||
"language": {"label": "Language", "sameAs": "http://purl.org/dc/terms/language"}, | |||
"license_path": {"label": "License Path", "sameAs": None}, |
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.
What is the difference between license and license_path, can this be merged?
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.
license
contains the license name/identifier, so something like mit
- we use this the same for the GitHub harvest as it's used by the metadata harvester. license_path
on the other hand is the file path to the license file in the repository, e.g. ./LICENSE.TXT
. It's relevant for one of the CESSDA-specific metric tests.
I'm not sure how they might be merged since we need both pieces of information for the tests. Happy to adjust this if you have any suggestions though!
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.
Ah I see, this is indeed different, so let's keep it
@@ -2,6 +2,10 @@ | |||
# | |||
# SPDX-License-Identifier: MIT | |||
|
|||
# coding: utf-8 | |||
|
|||
from datetime import date, datetime # noqa: F401 |
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.
Is this used here?
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.
Don't think so, it's auto-generated by swagger though (and pre-commit didn't seem to mind it).
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.
Ah I see, this is indeed different, so let's keep it
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.
Ups wrong comment.. as its auto-generated and not complained we better keep it;)
Description
This PR adds support for a new set of metrics, namely the FAIR4RS (research software) metrics as laid out in the deliverable available on Zenodo.
Specifically, the changes are as follows:
use_github
attribute to the API definition to make running this harvester optional (similar touse_datacite
)config/github.cfg
file to define a GitHub API token (providing one increases the rate limit)All these changes are non-breaking. Evaluators can still be associated with a single metric, but can also be modified as described below to cater to metrics from different sources. The GitHub harvester is disabled by default, so the behaviour does not change unless
use_github
is set.Details and notes
To allow an evaluator class (and its test functions) to be shared by metrics with different identifiers, the following steps were taken in the modified evaluator (
FAIREvaluatorLicense
):self.set_metric()
see codeself.metric_test_map
dictionary mapping test functions to (potentially) a list of metric test identifiers see codeThis required the following changes outside the modified evaluator class:
FAIREvaluator.set_metric()
to handle lists of metric identifiers as well as single metric strings see codeThe changes to the documentation are as follows:
fuji_server/data/README.md
with notes an what the data files are used forNotes on the chanegs generated by Swagger:
harvester.py
which after regenerating didn't have anauth_token
property and crashed some testsfrom datetime import date, datetime # noqa: F401
to every single modelfuji_server/models/any_of_fair_results_items.py
was re-generated asfuji_server/models/any_of_fair_results_results_items.py
with no further changesmaturity
was switched from typestr
to typeint
fuji_server/models/identifier_included_output.py
, the propertyobject_identifier_included
was addedRelated issue: #ISSUE_NUMBER
Motivation and context
The changes were necessary to
This PR also serves as an opportunity for feedback on the way the license evaluator was modified to allow for different metric test configurations, so that we can keep it in mind for the addition of future metrics.
How has this been tested?
Running
hatch run test
resulted in 18 passed tests with 9 deprecation warnings.Screenshots (if appropriate)
Types of changes
Checklist