Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
parser-mpes
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Rui Xian
parser-mpes
Commits
ad685151
Commit
ad685151
authored
6 years ago
by
RealPolitiX
Browse files
Options
Downloads
Patches
Plain Diff
Added Zenodo record
parent
42e080a9
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
mpesparser/__init__.py
+3
-11
3 additions, 11 deletions
mpesparser/__init__.py
tests/mpes.metadata_redacted.json
+2
-0
2 additions, 0 deletions
tests/mpes.metadata_redacted.json
with
5 additions
and
11 deletions
mpesparser/__init__.py
+
3
−
11
View file @
ad685151
...
@@ -59,10 +59,7 @@ class MPESParser(AbstractBaseParser):
...
@@ -59,10 +59,7 @@ class MPESParser(AbstractBaseParser):
with
open
(
filepath
,
'
rt
'
)
as
f
:
with
open
(
filepath
,
'
rt
'
)
as
f
:
data
=
json
.
load
(
f
)
data
=
json
.
load
(
f
)
# print(data)
# print(data)
# # You need to open sections before you can add values or sub sections to it.
# # The returned 'gid' can be used to reference a specific section if multiple
# # sections of the same type are opened.
root_gid
=
backend
.
openSection
(
'
section_experiment
'
)
root_gid
=
backend
.
openSection
(
'
section_experiment
'
)
# # Values do not necessarely have to be read from the parsed file.
# # Values do not necessarely have to be read from the parsed file.
# # The backend will check the type of the given value agains the metadata definition.
# # The backend will check the type of the given value agains the metadata definition.
...
@@ -70,8 +67,8 @@ class MPESParser(AbstractBaseParser):
...
@@ -70,8 +67,8 @@ class MPESParser(AbstractBaseParser):
#
#
# # Read data .
# # Read data .
# data_gid = backend.openSection('section_data')
# data_gid = backend.openSection('section_data')
#
backend.addValue('data_repository_name',
'zenodo.org
')
backend
.
addValue
(
'
data_repository_name
'
,
data
.
get
(
'
data_repository_name
'
)
)
#
backend.addValue('data_repository_url',
'https://zenodo.org/path/to/mydata
')
backend
.
addValue
(
'
data_repository_url
'
,
data
.
get
(
'
data_repository_url
'
)
)
# backend.addValue('data_preview_url', 'https://www.physicsforums.com/insights/wp-content/uploads/2015/09/fem.jpg')
# backend.addValue('data_preview_url', 'https://www.physicsforums.com/insights/wp-content/uploads/2015/09/fem.jpg')
# backend.closeSection('section_data', data_gid)
# backend.closeSection('section_data', data_gid)
...
@@ -162,11 +159,6 @@ class MPESParser(AbstractBaseParser):
...
@@ -162,11 +159,6 @@ class MPESParser(AbstractBaseParser):
backend
.
addValue
(
'
sample_substrate_state_of_matter
'
,
data
.
get
(
'
substrate_state
'
))
backend
.
addValue
(
'
sample_substrate_state_of_matter
'
,
data
.
get
(
'
substrate_state
'
))
backend
.
addValue
(
'
sample_substrate_vendor
'
,
data
.
get
(
'
substrate_vendor
'
))
backend
.
addValue
(
'
sample_substrate_vendor
'
,
data
.
get
(
'
substrate_vendor
'
))
# To add arrays (vectors, matrices, etc.) use addArrayValues and provide a
# numpy array. The shape of the numpy array must match the shape defined in
# the respective metadata definition.
# Close sections in the reverse order
# Close sections in the reverse order
# backend.closeSection('section_data', data_gid)
# backend.closeSection('section_data', data_gid)
backend
.
closeSection
(
'
section_experiment
'
,
root_gid
)
backend
.
closeSection
(
'
section_experiment
'
,
root_gid
)
...
...
This diff is collapsed.
Click to expand it.
tests/mpes.metadata_redacted.json
+
2
−
0
View file @
ad685151
{
{
"data_repository_name"
:
"zenodo.org"
,
"data_repository_url"
:
"https://zenodo.org/deposit/2704788"
,
"experiment_method"
:
"multidimensional photoemission spectroscopy"
,
"experiment_method"
:
"multidimensional photoemission spectroscopy"
,
"experiment_method_abbrv"
:
"MPES"
,
"experiment_method_abbrv"
:
"MPES"
,
"experiment_location"
:
"Hamburg, Germany"
,
"experiment_location"
:
"Hamburg, Germany"
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment