Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
normalizer-repo-tags
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nomad-lab
normalizer-repo-tags
Commits
cbf6fca0
Commit
cbf6fca0
authored
Nov 29, 2017
by
Jungho Shin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adding checksum
parent
cde1d1ff
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
9 deletions
+13
-9
normalizer/normalizer-repo-tags/calculate_repo_tags.py
normalizer/normalizer-repo-tags/calculate_repo_tags.py
+3
-3
normalizer/normalizer-repo-tags/extract_from_repo.py
normalizer/normalizer-repo-tags/extract_from_repo.py
+10
-6
No files found.
normalizer/normalizer-repo-tags/calculate_repo_tags.py
View file @
cbf6fca0
...
...
@@ -20,7 +20,7 @@ def calculateTags(inputDict, backend, calcUri):
repo_dic_sub_out
=
repo_dic_sub
.
communicate
(
inputDict_str
.
encode
(
'utf-8'
))[
0
]
repo_dic
=
json
.
loads
(
repo_dic_sub_out
.
decode
(
"utf-8"
))
#
backend.addValue("repository_checksum", repo_dic['checksum'])
backend
.
addValue
(
"repository_checksum"
,
repo_dic
[
'checksum'
])
backend
.
addValue
(
"repository_chemical_formula"
,
repo_dic
[
'formula'
])
backend
.
addValue
(
"repository_parser_id"
,
repo_dic
[
'prog_name'
]
+
' v1.0'
)
backend
.
addValue
(
"repository_atomic_elements"
,
repo_dic
[
'elements'
])
...
...
@@ -55,8 +55,8 @@ def main():
calcUri
,
parserInfo
=
{
'name'
:
'RepoTagsNormalizer'
,
'version'
:
'1.0'
})
#
dictReader=ParseStreamedDicts(sys.stdin)
dictReader
=
ParseStreamedDicts
(
open
(
"/u/jungho/myscratch/nomad-lab-base/normalizers/repo-tags/test/examples/scalaOut2.txt"
,
'r'
))
dictReader
=
ParseStreamedDicts
(
sys
.
stdin
)
#
dictReader=ParseStreamedDicts(open("/u/jungho/myscratch/nomad-lab-base/normalizers/repo-tags/test/examples/scalaOut2.txt", 'r'))
while
True
:
inputDict
=
dictReader
.
readNextDict
()
...
...
normalizer/normalizer-repo-tags/extract_from_repo.py
View file @
cbf6fca0
#import setup_paths, setup_paths_repo
import
sys
,
json
import
sqlalchemy
base_path
=
sys
.
exec_prefix
+
'/python'
sys
.
path
.
insert
(
0
,
base_path
)
from
nomadrepo.core.settings
import
connect_database
,
settings
from
nomadrepo.core.api
import
API
inputStr
=
sys
.
stdin
.
readline
()
def
extract_metadata
(
dic
):
def
extract_metadata
(
dic_in
):
session
=
connect_database
(
settings
,
None
)()
checksum
=
session
.
execute
(
"SELECT checksum FROM calculations WHERE calc_id = %d ;"
%
4000000
).
fetchone
()[
0
]
session
.
commit
();
session
.
close
()
work
=
API
()
for
calc
,
error
in
work
.
_parse
(
dic
,
"normalizerRepo"
):
for
calc
,
error
in
work
.
_parse
(
dic
_in
,
"normalizerRepo"
):
calc
,
error
=
work
.
classify
(
calc
)
calc
.
info
[
'oadate'
]
=
None
#calc.info['checksum'] = calc.get_checksum(
)
calc
.
info
[
'checksum'
]
=
str
(
checksum
)
json
.
dump
(
calc
.
info
,
sys
.
__stdout__
)
pass
def
main
():
inputStr
=
sys
.
stdin
.
readline
()
inputDict
=
json
.
loads
(
inputStr
)
extract_metadata
(
inputDict
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment