-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #171 from prjemian/159-uxml-writer
UXML plugin writer()
- Loading branch information
Showing
35 changed files
with
800 additions
and
1,533 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
|
||
.. _apstools_specwriter_plugin: | ||
|
||
apstools SpecWriterCallback metadata plugin | ||
########################################### | ||
|
||
Looks for ``#MD`` :index:`control line` control lines. | ||
These lines contain metadata supplied to the bluesky ``RunEngine`` | ||
and recorded during the execution of a scan. The data are stored | ||
in a dictionary of each scan: ``scan.MD``. If there are no | ||
``#MD`` control lines, then ``scan.MD`` does not exist. | ||
|
||
**see** https://apstools.readthedocs.io/en/latest/source/_filewriters.html#apstools.filewriters.SpecWriterCallback | ||
|
||
---- | ||
|
||
.. automodule:: spec2nexus.plugins.apstools_specwriter | ||
:members: | ||
:synopsis: Bluesky metadata from apstools SpecWriterCallback. |
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions
4
...ce/supplied_plugins/unicat_spec2nexus.rst → docs/source/supplied_plugins/unicat.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
|
||
.. _uxml_plugin: | ||
|
||
UXML metadata plugin | ||
#################### | ||
|
||
Looks for ``#UXML`` :index:`control line` control lines. | ||
These lines contain metadata written as XML structures | ||
and formatted according to the supplied XML Schema ``uxml.xsd`` | ||
in the same directory as the ``uxml.py`` plugin. | ||
The lines which comprise the XML are written as a list in | ||
each scan: ``scan.UXML``. If there are no | ||
``#UXML`` control lines, then ``scan.UXML`` does not exist. | ||
|
||
Once the scan has been fully read ``scan.UXML`` is converted | ||
into an XML document structure (using the *lxml.etree* package) | ||
which is stored in ``scan.UXML_root``. The structure is validated | ||
against the XML Schema ``uxml.xsd``. If invalid, the error message | ||
is reported by raising a ``UXML_Error`` python exception. | ||
|
||
A fully-validated structure can be written using the | ||
:class:`~spec2nexus.writer.Writer` class. The UXML metadata is | ||
written to the scan's ``NXentry`` group as subgroup named ``UXML`` | ||
with NeXus base class ``NXnote``. The hierarchy within this ``UXML`` | ||
is defined from the content provided in the SPEC scan. | ||
|
||
Please consult the XML Schema file for the rules governing the | ||
use of ``#UXML`` in a SPEC data file: | ||
* :download:`uxml.xsd <../../../src/spec2nexus/plugins/uxml.xsd>` | ||
|
||
|
||
---- | ||
|
||
.. automodule:: spec2nexus.plugins.uxml | ||
:members: | ||
:synopsis: UXML structured metadata. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
versioneer | ||
coverage | ||
coveralls |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
h5py | ||
lxml | ||
matplotlib | ||
numpy | ||
six |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#----------------------------------------------------------------------------- | ||
# :author: Pete R. Jemian | ||
# :email: jemian@anl.gov | ||
# :copyright: (c) 2017-2019, UChicago Argonne, LLC | ||
# | ||
# Distributed under the terms of the Creative Commons Attribution 4.0 International Public License. | ||
# | ||
# The full license is in the file LICENSE.txt, distributed with this software. | ||
#----------------------------------------------------------------------------- | ||
|
||
|
||
|
||
def learn_requirements(): | ||
""" | ||
list all installation requirements | ||
ALL packages & version restrictions stated in requirements.txt | ||
""" | ||
req_file = 'requirements.txt' | ||
reqs = [] | ||
|
||
import os | ||
path = os.path.dirname(__file__) | ||
req_file = os.path.join(path, '..', req_file) | ||
if not os.path.exists(req_file): | ||
# not needed with installed package | ||
return reqs | ||
|
||
excludes = "versioneer coveralls coverage".split() | ||
with open(req_file, 'r') as fp: | ||
buf = fp.read().strip().splitlines() | ||
for req in buf: | ||
req = req.strip() | ||
if req != "" \ | ||
and not req.startswith('#') \ | ||
and req not in excludes: | ||
reqs.append(req) | ||
return reqs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,4 +13,5 @@ | |
from . import apstools_specwriter | ||
from . import uim | ||
from . import unicat | ||
from . import uxml | ||
from . import XPCS |
Oops, something went wrong.