Skip to content

Commit 9b37723

Browse files
authored
Merge pull request #93 from CitrineInformatics/feature/rename-to-gemd
Rename `taurus` to `GEMD`
2 parents f49a2b2 + 7cb7e90 commit 9b37723

File tree

232 files changed

+8717
-5878
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

232 files changed

+8717
-5878
lines changed

.travis.yml

+4-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@ install:
88
- pip install --no-deps -e .
99
script:
1010
- pytest --cov=taurus --cov-report term-missing --cov-report term:skip-covered --cov-config=tox.ini
11-
--cov-fail-under=100 -s -r ./taurus
12-
- flake8 taurus
11+
--cov-fail-under=98 -s ./taurus
12+
- pytest --cov=gemd --cov-report term-missing --cov-report term:skip-covered --cov-config=tox.ini
13+
--cov-fail-under=100 -s ./gemd
14+
- flake8 gemd
1315
- cd docs; make html; cd ..;
1416
- touch ./docs/_build/html/.nojekyll
1517
deploy:

README.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,32 @@
1-
# taurus
2-
Python binding for Citrine's nextgen data model (codename: taurus).
1+
# GEMD-python
2+
Python binding for Citrine's nextgen data model, GEMD.
33

44
This package provides a framework for storing information about the processes that create materials, the materials themselves, and measurements performed on those materials.
55

66
## Usage
77

8-
To install `taurus`, you can simply:
8+
To install `gemd`, you can simply:
99
```
10-
$ pip install taurus-citrine
10+
$ pip install gemd
1111
```
1212

1313
Detailed documentation of the `GEMD` data model can be found in the [language-agnostic documentation](https://citrineinformatics.github.io/gemd-docs/).
14-
Documentation of this package can be found [here](https://citrineinformatics.github.io/taurus/).
14+
Documentation of this package can be found [here](https://citrineinformatics.github.io/gemd/).
1515

1616
## Developer instructions
1717
To download the repo and install requirements, run
1818

19-
```pip install git+https://github.com/CitrineInformatics/taurus.git```
19+
```pip install git+https://github.com/CitrineInformatics/gemd-python.git```
2020

2121
Tests are run with `pytest`, and the `pytest-cov` package is used to assess test coverage.
2222
In order to assess coverage locally, run `pytest` with the following arguments:
23-
* `--cov=taurus/` Assess coverage of all modules in the directory `taurus/` (required)
23+
* `--cov=gemd/` Assess coverage of all modules in the directory `gemd/` (required)
2424
* `--cov-report term-missing` Prints line numbers for lines that are not executed (optional)
2525
* `--cov-report term:skip-covered` Skips output for modules with full coverage (optional)
2626
* `--cov-report xml` Saves coverage report to `coverage.xml` (optional)
2727
* `--cov-fail-under=100` Throws an error if coverage is less than 100% (optional)
2828

2929
The following command will run all tests, print line numbers for lines that are not executed, skip modules with full coverage, and fail if coverage is less than 100%:
30-
`python -m pytest --cov=taurus/ --cov-report term:skip-covered --cov-report term-missing --cov-fail-under=100`
30+
`python -m pytest --cov=gemd/ --cov-report term:skip-covered --cov-report term-missing --cov-fail-under=100`
3131

3232

docs/source/conf.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@
1212
#
1313
import os
1414
import sys
15-
sys.path.insert(0, os.path.abspath('../../taurus'))
15+
sys.path.insert(0, os.path.abspath('../../gemd'))
1616

1717

1818
# -- Project information -----------------------------------------------------
1919

20-
project = 'Taurus'
21-
copyright = '2019, Citrine Informatics'
20+
project = 'GEMD'
21+
copyright = '2020, Citrine Informatics'
2222
author = 'Citrine Informatics'
2323

2424
# The full version, including alpha/beta/rc tags
@@ -40,7 +40,7 @@
4040
# build.
4141
#
4242
# See: https://github.com/sphinx-contrib/apidoc
43-
apidoc_module_dir = '../../taurus'
43+
apidoc_module_dir = '../../gemd'
4444
apidoc_output_dir = 'reference'
4545
apidoc_excluded_paths = ['tests']
4646
apidoc_separate_modules = True

docs/source/depth/serialization.rst

+18-18
Original file line numberDiff line numberDiff line change
@@ -4,37 +4,37 @@
44
Serialization (with Graphs!)
55
==============================
66

7-
Taurus objects link together to form graphs with directional edges.
8-
For example, a :class:`~taurus.entity.object.material_run.MaterialRun` links back to the :class:`~taurus.entity.object.process_run.ProcessRun` that produced it.
7+
GEMD objects link together to form graphs with directional edges.
8+
For example, a :class:`~gemd.entity.object.material_run.MaterialRun` links back to the :class:`~gemd.entity.object.process_run.ProcessRun` that produced it.
99
Some of these links are bi-directional.
10-
For example, a :class:`~taurus.entity.object.process_run.ProcessRun` also links forward to the :class:`~taurus.entity.object.material_run.MaterialRun` that it produces, if there is one.
10+
For example, a :class:`~gemd.entity.object.process_run.ProcessRun` also links forward to the :class:`~gemd.entity.object.material_run.MaterialRun` that it produces, if there is one.
1111
Other links are uni-directional.
12-
For example, a :class:`~taurus.entity.object.material_run.MaterialRun` links to its :class:`~taurus.entity.object.material_spec.MaterialSpec` but that :class:`~taurus.entity.object.material_spec.MaterialSpec` doesn't link back.
12+
For example, a :class:`~gemd.entity.object.material_run.MaterialRun` links to its :class:`~gemd.entity.object.material_spec.MaterialSpec` but that :class:`~gemd.entity.object.material_spec.MaterialSpec` doesn't link back.
1313
Uni-directional links are typically used when the multiplicity of a relationship can be large.
1414
For example, a material may be referenced in thousands of ingredients.
1515

16-
In taurus, bi-directional links are readable but only a single direction is writable.
17-
For example, a :class:`~taurus.entity.object.measurement_run.MeasurementRun` can set the :class:`~taurus.entity.object.material_run.MaterialRun` material that it was performed on,
18-
but a :class:`~taurus.entity.object.material_run.MaterialRun` cannot set the :class:`~taurus.entity.object.measurement_run.MeasurementRun`s it contains.
19-
Each time a :class:`~taurus.entity.object.measurement_run.MeasurementRun`'s ``material`` field is set,
20-
that :class:`~taurus.entity.object.material_run.MaterialRun` has the :class:`~taurus.entity.object.measurement_run.MeasurementRun` appended to its ``measurements`` field.
16+
In GEMD, bi-directional links are readable but only a single direction is writable.
17+
For example, a :class:`~gemd.entity.object.measurement_run.MeasurementRun` can set the :class:`~gemd.entity.object.material_run.MaterialRun` material that it was performed on,
18+
but a :class:`~gemd.entity.object.material_run.MaterialRun` cannot set the :class:`~gemd.entity.object.measurement_run.MeasurementRun`s it contains.
19+
Each time a :class:`~gemd.entity.object.measurement_run.MeasurementRun`'s ``material`` field is set,
20+
that :class:`~gemd.entity.object.material_run.MaterialRun` has the :class:`~gemd.entity.object.measurement_run.MeasurementRun` appended to its ``measurements`` field.
2121

2222
This linking structure presents several challenges for serialization and deserialization:
2323

2424
a. The graph cannot be traversed through uni-directional links in the wrong direction.
2525
b. Only the writeable side of bi-directional links can be persisted.
2626
c. Objects that are referenced by multiple objects must be deserialized to the same object.
2727

28-
These challenges are addressed by a custom json serialization procedure and the special :class:`~taurus.entity.link_by_uid.LinkByUID` class.
28+
These challenges are addressed by a custom json serialization procedure and the special :class:`~gemd.entity.link_by_uid.LinkByUID` class.
2929

3030
1. Each entity that doesn't already have at least one unique identifier is assigned a unique identifier so it can be referenced.
31-
2. The graph is flattened by traversing it while maintaining a seen list and replacing object references to other entities with :class:`~taurus.entity.link_by_uid.LinkByUID` objects, producing the set of entities that are reachable.
31+
2. The graph is flattened by traversing it while maintaining a seen list and replacing object references to other entities with :class:`~gemd.entity.link_by_uid.LinkByUID` objects, producing the set of entities that are reachable.
3232
3. The objects are sorted into a special "writable" order that ensures that link targets are created when deserializing.
3333
4. This sorted list of entities is assigned to the "context" field in the serialization output.
3434
5. The original object (which may contain multiple entities) is assigned to the "object" field in the serialization output.
35-
6. The serialization output is serialized with a special :class:`~json.JSONEncoder`, :class:`~taurus.json.taurus_encoder.TaurusEncoder`, that skips the soft side of links.
35+
6. The serialization output is serialized with a special :class:`~json.JSONEncoder`, :class:`~gemd.json.gemd_encoder.GEMDEncoder`, that skips the soft side of links.
3636

37-
Here's an example of the serialized output for a :class:`~taurus.entity.object.material_spec.MaterialSpec` and :class:`~taurus.entity.object.process_spec.ProcessSpec`:
37+
Here's an example of the serialized output for a :class:`~gemd.entity.object.material_spec.MaterialSpec` and :class:`~gemd.entity.object.process_spec.ProcessSpec`:
3838

3939
::
4040

@@ -81,10 +81,10 @@ Here's an example of the serialized output for a :class:`~taurus.entity.object.m
8181
The deserialization is a comparatively simple two-step process.
8282
First, the string or file is deserialized with python's builtin deserializer and a custom object hook.
8383
This hook does three things:
84-
it knows how to build taurus entities and other :class:`~taurus.entity.dict_serializable.DictSerializable` objects,
85-
it creates an index with the unique identifiers of the taurus entities that it has seen so far,
86-
and it replaces any :class:`~taurus.entity.link_by_uid.LinkByUID` that it encounters with objects from that index.
84+
it knows how to build GEMD entities and other :class:`~gemd.entity.dict_serializable.DictSerializable` objects,
85+
it creates an index with the unique identifiers of the gemd entities that it has seen so far,
86+
and it replaces any :class:`~gemd.entity.link_by_uid.LinkByUID` that it encounters with objects from that index.
8787
The only thing left to do is return the ``"object"`` item from the resulting dictionary.
8888

89-
This strategy is implemented in the :class:`~taurus.json.taurus_json.TaurusJson` class
90-
and conveniently exposed in the :py:mod:`taurus.json` module, which provides the familiar `json` interface.
89+
This strategy is implemented in the :class:`~gemd.json.gemd_json.GEMDJson` class
90+
and conveniently exposed in the :py:mod:`gemd.json` module, which provides the familiar `json` interface.

docs/source/depth/unit_parsing.rst

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ Unit Parsing
44

55
Unit parsing is performed using the Pint_ package.
66
By default, Pint supports a larger set of units than the Citrine Platform.
7-
Therefore, we include a custom unit definition file in Taurus: `citrine_en.txt`_.
7+
Therefore, we include a custom unit definition file in GEMD: `citrine_en.txt`_.
88
This file contains the most commonly used units and will grow over time.
99

10-
Requests for support of additional units can be made by opening an issue in the `taurus repository`_ on github.
10+
Requests for support of additional units can be made by opening an issue in the `GEMD repository`_ on github.
1111

1212
.. _Pint: https://pint.readthedocs.io/en/0.9/
13-
.. _citrine_en.txt: https://github.com/CitrineInformatics/taurus/blob/master/taurus/units/citrine_en.txt
14-
.. _taurus repository: https://github.com/CitrineInformatics/taurus
13+
.. _citrine_en.txt: https://github.com/CitrineInformatics/gemd/blob/master/gemd/units/citrine_en.txt
14+
.. _GEMD repository: https://github.com/CitrineInformatics/gemd

docs/source/index.rst

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
.. Taurus documentation master file, created by
1+
.. GEMD documentation master file, created by
22
sphinx-quickstart on Thu Aug 22 14:40:14 2019.
33
You can adapt this file completely to your liking, but it should at least
44
contain the root `toctree` directive.
55
6-
Welcome to the Taurus Documentation!
6+
Welcome to the GEMD Documentation!
77
===================================================
88

9-
Taurus is the Python implementation of the Citrine data model, the full documentation of which
10-
can be found `here <https://citrineinformatics.github.io/taurus-documentation/>`_.
9+
GEMD is the Python implementation of the Citrine data model, the full documentation of which
10+
can be found `here <https://citrineinformatics.github.io/gemd-docs/>`_.
1111

1212
To learn about the details of specific classes, please see the module index.
1313

gemd/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"""Data concepts library."""

gemd/client/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"""gemd client."""

gemd/client/json_encoder.py

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# flake8: noqa
2+
"""Encoding and decoding gemd objects to/from json."""
3+
import deprecation
4+
import gemd
5+
from gemd.json import GEMDEncoder, GEMDJson
6+
7+
8+
@deprecation.deprecated(deprecated_in="0.6.0", removed_in="0.7.0",
9+
details="Use gemd.json.dumps instead")
10+
def dumps(obj, **kwargs):
11+
return gemd.json.dumps(obj, **kwargs)
12+
13+
14+
@deprecation.deprecated(deprecated_in="0.6.0", removed_in="0.7.0",
15+
details="Use gemd.json.loads instead")
16+
def loads(json_str, **kwargs):
17+
return gemd.json.loads(json_str, **kwargs)
18+
19+
20+
@deprecation.deprecated(deprecated_in="0.6.0", removed_in="0.7.0",
21+
details="Use gemd.json.load instead")
22+
def load(fp, **kwargs):
23+
return gemd.json.load(fp, **kwargs)
24+
25+
26+
@deprecation.deprecated(deprecated_in="0.6.0", removed_in="0.7.0",
27+
details="Use gemd.json.dump instead")
28+
def dump(obj, fp, **kwargs):
29+
return gemd.json.dump(obj, fp, **kwargs)
30+
31+
32+
@deprecation.deprecated(deprecated_in="0.6.0", removed_in="0.7.0",
33+
details="Use gemd.json.GEMDJson().raw_dumps instead")
34+
def raw_dumps(obj, **kwargs):
35+
return GEMDJson().raw_dumps(obj, **kwargs)
36+
37+
38+
@deprecation.deprecated(deprecated_in="0.6.0", removed_in="0.7.0",
39+
details="Use gemd.json.GEMDJson().thin_dumps instead")
40+
def thin_dumps(obj, **kwargs):
41+
return GEMDJson().thin_dumps(obj, **kwargs)
42+
43+
44+
@deprecation.deprecated(deprecated_in="0.6.0", removed_in="0.7.0",
45+
details="Use gemd.json.GEMDJson().raw_loads instead")
46+
def raw_loads(json_str, **kwargs):
47+
return GEMDJson().raw_loads(json_str, **kwargs)
48+
49+
50+
@deprecation.deprecated(deprecated_in="0.6.0", removed_in="0.7.0",
51+
details="Use gemd.json.GEMDJson().copy instead")
52+
def copy(obj):
53+
return GEMDJson().copy(obj)

gemd/demo/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"""Demonstration of the data concepts library."""

0 commit comments

Comments
 (0)