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

Fix #42 Bug with Install Instructions / Requirements #43

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 16 additions & 3 deletions fuji_server/data/repodois.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ ardcx.curtin: https://doi.org/10.17616/R3WM02
ardcx.griffith: https://doi.org/10.17616/R3FG92
ardcx.usq: https://doi.org/10.17616/R36Q18
arfm.ufzdrp: https://doi.org/10.17616/R31NJN1M
awsod.roda: https://doi.org/10.17616/R3M91V
awzy.fednnv: https://doi.org/10.17616/R3PM1K
bamf.bamf: https://doi.org/10.17616/R31NJMZ5
bf.discover: https://doi.org/10.17616/R31NJMN0
Expand Down Expand Up @@ -48,6 +49,7 @@ bl.ukda: https://doi.org/10.17616/R3088K
bmbf.hirzqt: https://doi.org/10.17616/R3CK9G
brown.bdr: https://doi.org/10.17616/R3193B
brvz.rdr: https://doi.org/10.17616/R31NJN5S
bvbw.dhbqgy: https://doi.org/10.17616/R3H35C
caltech.data: https://doi.org/10.17616/R3SW99
carl.frdr: https://doi.org/10.17616/R3X50W
cbg.datasets: https://doi.org/10.17616/R3PP7J
Expand Down Expand Up @@ -90,6 +92,7 @@ dkrz.wdcc: https://doi.org/10.17616/R3989R
dryad.dryad: https://doi.org/10.17616/R34S33
dzhw.fdz-dzhw: https://doi.org/10.17616/R3BR0G
elsevier.md: https://doi.org/10.17616/R3DD11
epua.rdcrki: https://doi.org/10.17616/R3K31G
esdis.ornl: https://doi.org/10.17616/R3SG61
estdoi.keel: https://doi.org/10.17616/R3P636
estdoi.qdb: https://doi.org/10.17616/R31NJMVF
Expand Down Expand Up @@ -131,8 +134,8 @@ gesis.dezim: https://doi.org/10.17616/R31NJMNK
gesis.gesis: https://doi.org/10.17616/R3BB70
gesis.icpsr: https://doi.org/10.17616/R3BC8Q
gesis.indepth: https://doi.org/10.17616/R3432T
gesis.iqb: https://doi.org/10.17616/R3M30D
gesis.neps: https://doi.org/10.17616/R35P7W
gesis.rki: https://doi.org/10.17616/R3K31G
gesis.share: https://doi.org/10.17616/R3BK5N
gesis.sodanet: https://doi.org/10.17616/R38G7R
gesis.srda: https://doi.org/10.17616/R31NJMLA
Expand All @@ -141,6 +144,7 @@ gesis.zpid: https://doi.org/10.17616/R3FS48
hain.njltcl: https://doi.org/10.17616/R31NJNAM
heliophy.spdf: https://doi.org/10.17616/R3P301
hlqc.znxeli: https://doi.org/10.17616/R31NJMJP
hyfx.gqlzxo: https://doi.org/10.17616/R31NJNDH
ieee.dataport: https://doi.org/10.17616/R3H77H
iiasa.dare: https://doi.org/10.17616/R31NJMH0
illinois.databank: https://doi.org/10.17616/R3C93F
Expand All @@ -150,7 +154,7 @@ inist.humanum: https://doi.org/10.17616/R3JM1B
inist.ifremer: https://doi.org/10.17616/R31NJMHX
inist.ifsttar: https://doi.org/10.17616/R31NJMKM
inist.ill: https://doi.org/10.17616/R33H18
inist.inra: https://doi.org/10.17616/R3DJ4J
inist.osuna: https://doi.org/10.17616/R31NJNKA
inist.otelo: https://doi.org/10.17616/R3F19K
inist.resif: https://doi.org/10.17616/R37Q06
iris.iris: https://doi.org/10.17616/R3X607
Expand All @@ -161,6 +165,7 @@ jbru.bbees: https://doi.org/10.17616/R31NJNEN
jcvi.eivbwb: https://doi.org/10.17616/R30P93
jcvi.gxpwaq: https://doi.org/10.17616/R3S634
kaggle.kaggle: https://doi.org/10.17616/R32N5V
kim.colabfit: https://doi.org/10.17616/R31NJNJL
kim.openkim: https://doi.org/10.17616/R3SK8T
kmot.rdr: https://doi.org/10.17616/R31NJMN6
ktsw.aezvvv: https://doi.org/10.17616/R31NJMVX
Expand All @@ -173,6 +178,7 @@ mdw.repository: https://doi.org/10.17616/R30M00
mit.physio: https://doi.org/10.17616/R3D06S
mlbs.skuxgs: https://doi.org/10.17616/R3ZP8D
nasapds.nasapds: https://doi.org/10.17616/R37593
nbqj.daks: https://doi.org/10.17616/R31NJMZS
nkn.nkn: https://doi.org/10.17616/R3JK91
nlqq.xoncsf: https://doi.org/10.17616/R31NJMYB
noaa.ncei: https://doi.org/10.17616/R3362J
Expand All @@ -192,8 +198,13 @@ psu.datacom: https://doi.org/10.17616/R31NJMGV
psu.scholar: https://doi.org/10.17616/R34W4H
pu.dataspace: https://doi.org/10.17616/R33B6F
purdue.purduelib: https://doi.org/10.17616/R3V90N
rdg.prod: https://doi.org/10.17616/R31NJN8R
repod.dbuw: https://doi.org/10.17616/R31NJNHR
repod.mxrdr: https://doi.org/10.17616/R31NJMYU
repod.rds: https://doi.org/10.17616/R31NJMYP
rg.rg: https://doi.org/10.17616/R36H16
rice.kinder: https://doi.org/10.17616/R3GB90
rpak.zvrzin: https://doi.org/10.17616/R31NJNLV
sagebio.synapse: https://doi.org/10.17616/R3B934
si.cda: https://doi.org/10.17616/R3201S
si.si: https://doi.org/10.17616/R3W49N
Expand Down Expand Up @@ -224,9 +235,11 @@ tib.kit4radar: https://doi.org/10.17616/R31NJMVU
tib.ldeo: https://doi.org/10.17616/R3PV10
tib.luis: https://doi.org/10.17616/R3C519
tib.radar: https://doi.org/10.17616/R3ZX96
tib.repod: https://doi.org/10.17616/R3JS93
tib.tuhh: https://doi.org/10.17616/R31NJML0
tib.ub-hro: https://doi.org/10.17616/R31NJMQH
tib.ubbs: https://doi.org/10.17616/R31NJMTU
tib.ubmr: https://doi.org/10.17616/R31NJMTD
tib.ukon: https://doi.org/10.17616/R3M024
tib.zih: https://doi.org/10.17616/R31NJMHY
tuw.tethys: https://doi.org/10.17616/R31NJMU0
Expand All @@ -237,7 +250,7 @@ umn.drum: https://doi.org/10.17616/R30D19
umn.ipums: https://doi.org/10.17616/R3ZS59
undr.undr: https://doi.org/10.17616/R31NJN9K
unimelb.repo1: https://doi.org/10.17616/R3HH10
unm.dataone: https://doi.org/10.17616/R3101G
unisalzb.anc: https://doi.org/10.17616/R31NJNKJ
usda.usda: https://doi.org/10.17616/R3G051
usgs.prod: https://doi.org/10.17616/R33S3S
uva.libra: https://doi.org/10.17616/R3TS86
Expand Down
3 changes: 2 additions & 1 deletion fuji_server/data/software_file.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
],
"parse": "file_name",
"pattern": [
"requirements\\.txt"
"requirements\\.txt",
"pyproject\\.toml"
]
},
"docs_directory": {
Expand Down
10 changes: 7 additions & 3 deletions fuji_server/evaluators/fair_evaluator_requirements.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def nestedDataContainsKeyword(self, data, key):
)
for d in values:
if isinstance(d, bytes):
d = d.decode("utf-8")
d = d.decode("utf-8", errors="replace")
if isinstance(d, str):
if key in d.lower():
return True
Expand Down Expand Up @@ -88,13 +88,17 @@ def scanForKeywords(self, keywords, locations):
content = self.fuji.github_data.get(location)
if content is not None:
if isinstance(content, bytes):
content = content.decode("utf-8")
content = content.decode("utf-8", errors="replace")
if isinstance(content, str):
if k in content.lower():
hit_dict[k] = True # found keyword in location
keys_to_check.remove(k) # stop looking, have found something for this key
else:
hit_dict[k] = self.nestedDataContainsKeyword(content, k)
if hit_dict[k] is True:
keys_to_check.remove(k) # Need to also stop looking
self.logger.info(
f"{self.metric_identifier} : Found {k} in {location}."
) # Info message for specific keys
return hit_dict

def testInstructions(self):
Expand Down
3 changes: 2 additions & 1 deletion fuji_server/yaml/metrics_v0.7_software.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,7 @@ metrics:
required:
dependency_file:
- requirements.txt
- pyproject.toml
- target: https://f-uji.net/vocab/metadata/standards
modality: all
required:
Expand All @@ -367,7 +368,7 @@ metrics:
- deploy
created_by: FAIR4RS
date_created: 2024-01-18
date_updated: 2024-01-18
date_updated: 2024-08-28
version: 0.1
total_score: 2
- metric_identifier: FRSM-14-R1
Expand Down

Large diffs are not rendered by default.

54 changes: 27 additions & 27 deletions tests/functional/test_evaluation.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,13 +176,13 @@ def test_evaluation_software(client: FlaskClient) -> None:
response = client.post(valid_url, json=payload, headers=headers)
assert response.status_code == HTTP_200_OK

# these are the results from 2024-05-03
# these are the results from 2024-08-30
expected = {
"score_earned": {
"A": 0,
"F": 0,
"I": 0,
"R": 4,
"R": 5,
"A1": 0,
"F1": 0,
"F1.1": 0,
Expand All @@ -192,10 +192,10 @@ def test_evaluation_software(client: FlaskClient) -> None:
"F4": 0,
"I1": 0,
"I2": 0,
"R1": 0,
"R1": 1,
"R1.1": 4,
"R1.2": 0,
"FAIR": 4.0,
"FAIR": 5,
},
"score_total": {
"A": 2,
Expand All @@ -214,26 +214,26 @@ def test_evaluation_software(client: FlaskClient) -> None:
"R1": 8,
"R1.1": 5,
"R1.2": 3,
"FAIR": 45.0,
"FAIR": 45,
},
"score_percent": {
"A": 0.0,
"F": 0.0,
"I": 0.0,
"R": 25.0,
"A1": 0.0,
"F1": 0.0,
"F1.1": 0.0,
"F1.2": 0.0,
"F2": 0.0,
"F3": 0.0,
"F4": 0.0,
"I1": 0.0,
"I2": 0.0,
"R1": 0.0,
"R1.1": 80.0,
"R1.2": 0.0,
"FAIR": 8.89,
"A": 0,
"F": 0,
"I": 0,
"R": 31.25,
"A1": 0,
"F1": 0,
"F1.1": 0,
"F1.2": 0,
"F2": 0,
"F3": 0,
"F4": 0,
"I1": 0,
"I2": 0,
"R1": 12.5,
"R1.1": 80,
"R1.2": 0,
"FAIR": 11.11,
},
"status_total": {
"A1": 1,
Expand Down Expand Up @@ -264,14 +264,14 @@ def test_evaluation_software(client: FlaskClient) -> None:
"F4": 0,
"I1": 0,
"I2": 0,
"R1": 0,
"R1": 1,
"R1.1": 2,
"R1.2": 0,
"A": 0,
"F": 0,
"I": 0,
"R": 2,
"FAIR": 2,
"R": 3,
"FAIR": 3,
},
"maturity": {
"A": 0,
Expand All @@ -287,10 +287,10 @@ def test_evaluation_software(client: FlaskClient) -> None:
"F4": 0,
"I1": 0,
"I2": 0,
"R1": 0,
"R1": 1,
"R1.1": 3,
"R1.2": 0,
"FAIR": 1.0,
"FAIR": 1,
},
}
response_json = response.json()
Expand Down