diff --git a/normalizer/normalizer-repo-tags/0.COMMENT_from_Jungho b/normalizer/normalizer-repo-tags/0.COMMENT_from_Jungho new file mode 100644 index 0000000000000000000000000000000000000000..2b2a4adc7f3f4dfebfbba984a153741b94fbc51a --- /dev/null +++ b/normalizer/normalizer-repo-tags/0.COMMENT_from_Jungho @@ -0,0 +1,9 @@ + +(1) New modlue added by Jungho +NomadRepositoryParser: Entire python module of Repository parser from 'git@gitlab.mpcdf.mpg.de:NoMaD/NomadRepositoryParser.git'. This can be considered as submodule. + +(2) New file added by Jungho +convert_2to3.sh: Python 2.7 scripts from the NomadRepositoryParser module needs to conver to that of Python 3.0. Only need to excute when the related files are updated from the git repository. + +(3) New file added by Jungho +requirements.txt: Requirements to import NomadRepositoryParser. diff --git a/normalizer/normalizer-repo-tags/NomadRepositoryParser b/normalizer/normalizer-repo-tags/NomadRepositoryParser new file mode 160000 index 0000000000000000000000000000000000000000..cb1fc51a3e9c1312b7a0de942e94e6af7225a0b4 --- /dev/null +++ b/normalizer/normalizer-repo-tags/NomadRepositoryParser @@ -0,0 +1 @@ +Subproject commit cb1fc51a3e9c1312b7a0de942e94e6af7225a0b4 diff --git a/normalizer/normalizer-repo-tags/calculate_repo_tags.py b/normalizer/normalizer-repo-tags/calculate_repo_tags.py index 2f05f21c608b493bd8abf9a77dadbf7fa26e5306..8904b7a593b2b1d00fae037d1501685fd1350b79 100644 --- a/normalizer/normalizer-repo-tags/calculate_repo_tags.py +++ b/normalizer/normalizer-repo-tags/calculate_repo_tags.py @@ -6,6 +6,8 @@ from nomadcore.parser_backend import JsonParseEventsWriterBackend from nomadcore.parse_streamed_dicts import * import logging +from nomadrepo.parsers import Output + base_path = os.path.abspath(os.path.dirname(__file__)) def calculateTags(inputDict, backend, calcUri): @@ -15,6 +17,10 @@ def calculateTags(inputDict, backend, calcUri): else: backend.openContext(calcUri) repoSect = backend.openSection("section_repository_info") + print ("< ##### inputDict ##### ", inputDict, "##### >") + print ("***", inputDict.keys(), "***") + print ("Output:", Output) + #help(backend.addValue) # fill out i.e. backend.addValue unsing input Dict # "repository_checksum", # "repository_chemical_formula", @@ -51,7 +57,8 @@ def main(): calcUri, parserInfo = {'name':'RepoTagsNormalizer', 'version': '1.0'}) - dictReader=ParseStreamedDicts(sys.stdin) + #dictReader=ParseStreamedDicts(sys.stdin) + dictReader=ParseStreamedDicts(open("/u/jungho/myscratch/nomad-lab-base/normalizers/repo-tags/test/examples/scalaOut1.txt", 'r')) while True: inputDict=dictReader.readNextDict() diff --git a/normalizer/normalizer-repo-tags/convert_2to3.sh b/normalizer/normalizer-repo-tags/convert_2to3.sh new file mode 100755 index 0000000000000000000000000000000000000000..7a882e54fedde8312627a2f08582336be18ff290 --- /dev/null +++ b/normalizer/normalizer-repo-tags/convert_2to3.sh @@ -0,0 +1 @@ +2to3 -w NomadRepositoryParser/python/nomadrepo/core/settings.py diff --git a/normalizer/normalizer-repo-tags/requirements.txt b/normalizer/normalizer-repo-tags/requirements.txt new file mode 100755 index 0000000000000000000000000000000000000000..c9e1328d858f914d1f13a892fcb6317e5479a9c9 --- /dev/null +++ b/normalizer/normalizer-repo-tags/requirements.txt @@ -0,0 +1 @@ +sqlalchemy == 1.0.6 diff --git a/normalizer/normalizer-repo-tags/setup_paths.py b/normalizer/normalizer-repo-tags/setup_paths.py index e0a0fb009256a0d4056e81c12e82d15bfd3ea7c4..a683d3fbed711fce496825a2c0f1aa0a7d6cb43b 100644 --- a/normalizer/normalizer-repo-tags/setup_paths.py +++ b/normalizer/normalizer-repo-tags/setup_paths.py @@ -1,6 +1,10 @@ import sys, os, os.path baseDir = os.path.dirname(os.path.abspath(__file__)) commonDir = os.path.normpath(os.path.join(baseDir,"../../../../python-common/common/python")) +repoParserDir = os.path.normpath(os.path.join(baseDir,"NomadRepositoryParser/python/")) if not commonDir in sys.path: sys.path.insert(0, commonDir) + +if not repoParserDir in sys.path: + sys.path.insert(0, repoParserDir)