From a13eefc48b9168fe2b2c260c8ed5806c00d5116f Mon Sep 17 00:00:00 2001 From: Jungho Shin <jungho@physik.hu-berlin.de> Date: Thu, 7 Sep 2017 15:43:56 +0200 Subject: [PATCH] Adding some new files --- normalizer/normalizer-repo-tags/0.COMMENT_from_Jungho | 9 +++++++++ normalizer/normalizer-repo-tags/NomadRepositoryParser | 1 + normalizer/normalizer-repo-tags/calculate_repo_tags.py | 9 ++++++++- normalizer/normalizer-repo-tags/convert_2to3.sh | 1 + normalizer/normalizer-repo-tags/requirements.txt | 1 + normalizer/normalizer-repo-tags/setup_paths.py | 4 ++++ 6 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 normalizer/normalizer-repo-tags/0.COMMENT_from_Jungho create mode 160000 normalizer/normalizer-repo-tags/NomadRepositoryParser create mode 100755 normalizer/normalizer-repo-tags/convert_2to3.sh create mode 100755 normalizer/normalizer-repo-tags/requirements.txt 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 0000000..2b2a4ad --- /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 0000000..cb1fc51 --- /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 2f05f21..8904b7a 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 0000000..7a882e5 --- /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 0000000..c9e1328 --- /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 e0a0fb0..a683d3f 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) -- GitLab