Skip to content

Commit

Permalink
Merge pull request #113 from Str3am786/soca_3.10
Browse files Browse the repository at this point in the history
Fixes to issues, and updating url to dashboard
  • Loading branch information
dgarijo authored Dec 8, 2023
2 parents 6da16d4 + f408c96 commit b70b875
Show file tree
Hide file tree
Showing 9 changed files with 236 additions and 208 deletions.
2 changes: 1 addition & 1 deletion src/soca/assets/template.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<h2 id="nav-title">Software Catalog</h2>
<input id="searchBar" placeholder="Search for repositories..." title="Type in a repository" type="text"/>
<div data-toggle="tooltip" data-placement="right" title="About page"><a href="about.html"><img src="img/help.png" class="grey-color-svg" style="height: 2rem; margin-left: 1rem;"></a></div>
<div data-toggle="tooltip" data-placement="right" title="SOCA Dashboard Analytics"><a href="https://dashboards-software.oeg.fi.upm.es/d/FX3TNka4k/prototype?orgId=1&from=now-6M&to=now&var-organisation=oeg-upm&var-SOCA_Version=0.0.2&var-SOMEF_Version=0.9.3&kiosk" target="_blank"><img src="img/statIcon.svg" class="grey-color-svg" style="height: 2rem; margin-left: 1rem;"></a></div>
<div data-toggle="tooltip" data-placement="right" title="SOCA Dashboard Analytics"><a href="https://dashboards-software.oeg.fi.upm.es/d/FX3TNka4k/prototype?orgId=1&from=now-6M&to=now&var-organisation=oeg-upm&var-SOCA_Version=0.0.3&var-SOMEF_Version=0.9.3&kiosk" target="_blank"><img src="img/statIcon.svg" class="grey-color-svg" style="height: 2rem; margin-left: 1rem;"></a></div>
</div>

<div class="filters-wrapper">
Expand Down
2 changes: 1 addition & 1 deletion src/soca/commands/create_summary.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from datetime import date, datetime
import json
import os
from soca import __version__ as soca_ver
from .. import __version__ as soca_ver
from somef import __version__ as somef_ver
from .upload_summary import upload_summary

Expand Down
396 changes: 199 additions & 197 deletions src/soca/commands/portal/metadata.py

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions src/soca/commands/portal/portal.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
from . import card
from . import scripts
from . import metadata
from soca import base_dir
from soca import __version__
from ... import base_dir, __version__


def generate(repo_metadata_dir, output, title, favicon):
Expand Down
2 changes: 1 addition & 1 deletion src/soca/commands/portal/scripts.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from soca import base_dir
from ... import base_dir

def singleton(class_):
instances = {}
Expand Down
2 changes: 1 addition & 1 deletion src/soca/commands/portal/styles.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from soca import base_dir
from ... import base_dir

def singleton(class_):
instances = {}
Expand Down
2 changes: 1 addition & 1 deletion src/soca/commands/upload_summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def summaryToDatabase(summary_output):
'num_doi': summary_output['identifiers']['num_pid'],
'num_pid': summary_output['identifiers']['num_pid'],
'num_withoutId': summary_output['identifiers']['num_without_identifier'],
'num_withId': summary_output['identifiers']['num_pid'] +summary_output['identifiers']['num_pid'],
'num_withId': summary_output['identifiers']['num_pid'] +summary_output['identifiers']['num_doi'],
'num_Apache': summary_output['licenses']['APACHE'],
'num_GPL': summary_output['licenses']['GPL'],
'num_MIT': summary_output['licenses']['MIT'],
Expand Down
1 change: 1 addition & 0 deletions tests/json_files/issue_111_mapeathor.json

Large diffs are not rendered by default.

34 changes: 30 additions & 4 deletions tests/test-scc.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
from pathlib import Path
from datetime import datetime

import soca.commands.portal.metadata as md
import soca.commands.portal.portal as portal
import soca.commands.create_summary as summary
import src.soca.commands.portal.metadata as md
import src.soca.commands.portal.portal as portal
import src.soca.commands.create_summary as summary
#from ..src.soca.commands.portal.metadata import metadata as m
import soca.commands.extract_metadata as ex
import src.soca.commands.extract_metadata as ex


class test_soca(TestCase):
Expand Down Expand Up @@ -435,6 +435,9 @@ def test_r4r(self):
r4r.html_repo_icons()
pass



#TODO move into its own class, for summary testing
def test_ontology(self):
path = Path(__file__).parent / "json_files" / "ontologytest.json"
with path.open() as f:
Expand All @@ -446,6 +449,29 @@ def test_ontology(self):
if len(dir) == 0:
os.rmdir(path2)
pass

#Tests for issues/repos that cause problems metadata.py

def test_issue111(self):
"""This is to test CFF extraction"""
path = Path(__file__).parent / "json_files" / "issue_111_mapeathor.json"
with path.open() as f:
mapjayson = json.load(f)
f.close()
meta = md.metadata(path, mapjayson)
result = meta.citations()
assert(result['cff'])
def test_issue111_2(self):
"""Mapeathor test to see if the card is built properly"""
path = Path(__file__).parent / "json_files" / "issue_111_mapeathor.json"
with path.open() as f:
mapjayson = json.load(f)
f.close()
meta = md.metadata(path, mapjayson)
res = meta.html_repo_icons()
result = "cff-version: 1.0.0" in res
self.assertTrue(result)



if __name__ == '__main__':
Expand Down

0 comments on commit b70b875

Please sign in to comment.