Skip to content

Commit 96a17dd

Browse files
authored
Merge pull request #11 from CitrineInformatics/release/0.1.0
Taurus v0.1.0 is released!
2 parents 510f3b1 + 2e9678b commit 96a17dd

File tree

129 files changed

+8279
-4
lines changed

Some content is hidden

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

129 files changed

+8279
-4
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ wheels/
2525
*.egg
2626
MANIFEST
2727

28+
# Sphinx docs
29+
docs/source/reference/
30+
2831
# PyInstaller
2932
# Usually these files are written by a python script from a template
3033
# before PyInstaller builds the exe, so as to inject date/other infos into it.

.travis.yml

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
language: python
2+
python:
3+
- '3.5'
4+
- '3.6'
5+
install:
6+
- pip install -U -r requirements.txt
7+
- pip install -U -r test_requirements.txt
8+
- pip install --no-deps -e .
9+
script:
10+
- pytest --flake8 --cov=taurus --cov-report term-missing --cov-report term:skip-covered
11+
--cov-fail-under=91 -s -r ./taurus
12+
- cd docs; make html; cd ..;
13+
- touch ./docs/_build/html/.nojekyll
14+
deploy:
15+
- provider: pages
16+
skip_cleanup: true
17+
github_token: "$GH_SECRET_TOKEN"
18+
keep_history: true
19+
local_dir: "./docs/_build/html/"
20+
on:
21+
branch: master
22+
- provider: pypi
23+
user: "CitrineInformatics"
24+
password: "$PYPI_PASSWORD"
25+
distributions: "sdist bdist_wheel"
26+
skip_existing: true
27+
on:
28+
tags: true
29+
env:
30+
global:
31+
- secure: EShDEfEJhStL9RJNZG5eKDNYhH8s7TtiS2rnm/lFikjDjXyL1nuyjtvc7TCGW/tHCRk0/kvFCoQhgDUZeqrDkqQhK9johy9gNhqp/C6TbLxBvVYw8pxOYB9ljpw98WewChjqKOlNBNLhEFXiFWCpTkDX0sC8stSNpxTcxe4atWI+xVbMxnrzf8DfILuyCcnDzCZOcWkVNtZxoiia3JLqwFJH6f5FYL6j3+5GTDE+wPlH/k1G9CSY76tf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zlYJ746ZW8ltZSgJvD5DJBV+NUvLT2bkAXH5KA1E3ccq/ztTsSNuh4="
33+

CONTRIBUTING.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Contributing
2+
3+
## Coding Style
4+
This project follows [PEP8](https://www.python.org/dev/peps/pep-0008/), with the following exceptions:
5+
* Maximum line length is 99 characters
6+
7+
For additional (non-binding) inspiration, check out the [Google Python Style Guide](https://github.com/google/styleguide/blob/gh-pages/pyguide.md).

README.md

+25-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,29 @@
1-
# disclaimer
2-
31
# taurus
4-
Data concepts for Next Gen platform.
5-
Provides a framework for storing information about the processes that create materials, the materials themselves, and measurements performance on those materials.
2+
Python binding for Citrine's nextgen data concepts (codename: taurus).
3+
64

5+
Provides a framework for storing information about the processes that create materials, the materials themselves, and measurements performance on those materials.
76
Detailed documentation of the next gen format can be found in the language-agnostic documentation.
87

8+
## Installation
9+
To download the repo and install requirements, run
10+
11+
```pip install git+https://github.com/CitrineInformatics/taurus.git```
12+
13+
Tests are run with `pytest`, and the `pytest-cov` package is used to assess test coverage.
14+
In order to assess coverage locally, run `pytest` with the following arguments:
15+
* `--cov=taurus/` Assess coverage of all modules in the directory `taurus/` (required)
16+
* `--cov-report term-missing` Prints line numbers for lines that are not executed (optional)
17+
* `--cov-report term:skip-covered` Skips output for modules with full coverage (optional)
18+
* `--cov-report xml` Saves coverage report to `coverage.xml` (optional)
19+
* `--cov-fail-under=85` Throws an error if coverage is less than 85% (optional)
20+
21+
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 85%:
22+
`python -m pytest --cov=taurus/ --cov-report term:skip-covered --cov-report term-missing --cov-fail-under=85`
23+
24+
## Usage
25+
Ingester scripts are used to import real-world materials data.
26+
The results can then be serialized to JSON, and deserialized back into Taurus.
27+
28+
An example ingester can be found in `/taurus/ingest/material_run_example.py`, and code that feeds example data into the ingester is at `taurus/ingest/tests/test_material_run_example.py`.
29+
For details, see `taurus/ingest/readme.md`.

docs/Makefile

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line, and also
5+
# from the environment for the first two.
6+
SPHINXOPTS ?=
7+
SPHINXBUILD ?= sphinx-build
8+
SOURCEDIR = source
9+
BUILDDIR = _build
10+
11+
# Put it first so that "make" without argument is like "make help".
12+
help:
13+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14+
15+
.PHONY: help Makefile
16+
17+
# Catch-all target: route all unknown targets to Sphinx using the new
18+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19+
%: Makefile
20+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

docs/make.bat

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
@ECHO OFF
2+
3+
pushd %~dp0
4+
5+
REM Command file for Sphinx documentation
6+
7+
if "%SPHINXBUILD%" == "" (
8+
set SPHINXBUILD=sphinx-build
9+
)
10+
set SOURCEDIR=source
11+
set BUILDDIR=build
12+
13+
if "%1" == "" goto help
14+
15+
%SPHINXBUILD% >NUL 2>NUL
16+
if errorlevel 9009 (
17+
echo.
18+
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
19+
echo.installed, then set the SPHINXBUILD environment variable to point
20+
echo.to the full path of the 'sphinx-build' executable. Alternatively you
21+
echo.may add the Sphinx directory to PATH.
22+
echo.
23+
echo.If you don't have Sphinx installed, grab it from
24+
echo.http://sphinx-doc.org/
25+
exit /b 1
26+
)
27+
28+
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
29+
goto end
30+
31+
:help
32+
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
33+
34+
:end
35+
popd

docs/source/conf.py

+70
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# Configuration file for the Sphinx documentation builder.
2+
#
3+
# This file only contains a selection of the most common options. For a full
4+
# list see the documentation:
5+
# https://www.sphinx-doc.org/en/master/usage/configuration.html
6+
7+
# -- Path setup --------------------------------------------------------------
8+
9+
# If extensions (or modules to document with autodoc) are in another directory,
10+
# add these directories to sys.path here. If the directory is relative to the
11+
# documentation root, use os.path.abspath to make it absolute, like shown here.
12+
#
13+
import os
14+
import sys
15+
sys.path.insert(0, os.path.abspath('../../taurus'))
16+
17+
18+
# -- Project information -----------------------------------------------------
19+
20+
project = 'Taurus'
21+
copyright = '2019, Citrine Informatics'
22+
author = 'Citrine Informatics'
23+
24+
# The full version, including alpha/beta/rc tags
25+
release = '0.0.0'
26+
27+
28+
# -- General configuration ---------------------------------------------------
29+
30+
# Add any Sphinx extension module names here, as strings. They can be
31+
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
32+
# ones.
33+
extensions = [
34+
'sphinxcontrib.apidoc',
35+
'sphinx.ext.napoleon'
36+
]
37+
38+
# Use the sphinxcontrib.apidoc extension to wire in the sphinx-apidoc invocation
39+
# to the build process, eliminating the need for an extra call during the
40+
# build.
41+
#
42+
# See: https://github.com/sphinx-contrib/apidoc
43+
apidoc_module_dir = '../../taurus'
44+
apidoc_output_dir = 'reference'
45+
apidoc_excluded_paths = ['tests']
46+
apidoc_separate_modules = True
47+
48+
# Add any paths that contain templates here, relative to this directory.
49+
templates_path = ['_templates']
50+
51+
# List of patterns, relative to source directory, that match files and
52+
# directories to ignore when looking for source files.
53+
# This pattern also affects html_static_path and html_extra_path.
54+
exclude_patterns = []
55+
56+
57+
# -- Options for HTML output -------------------------------------------------
58+
59+
# The theme to use for HTML and HTML Help pages. See the documentation for
60+
# a list of builtin themes.
61+
#
62+
html_theme = 'alabaster'
63+
64+
# Add any paths that contain custom static files (such as style sheets) here,
65+
# relative to this directory. They are copied after the builtin static files,
66+
# so a file named "default.css" will overwrite the builtin "default.css".
67+
html_static_path = ['_static']
68+
69+
# autodoc_mock_imports allows Spyinx to ignore any external modules listed in the array
70+
autodoc_mock_imports = []

docs/source/index.rst

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
.. Taurus documentation master file, created by
2+
sphinx-quickstart on Thu Aug 22 14:40:14 2019.
3+
You can adapt this file completely to your liking, but it should at least
4+
contain the root `toctree` directive.
5+
6+
Welcome to the Taurus Documentation!
7+
===================================================
8+
9+
.. toctree::
10+
:maxdepth: 2
11+
:caption: Contents:
12+
13+
Taurus is the Python implementation of the Citrine data model, the full documentation of which
14+
can be found `here <https://citrineinformatics.github.io/taurus-documentation/>`_.
15+
16+
To learn about the details of specific classes, please see the module index.
17+
18+
Table of Contents
19+
-----------------
20+
21+
.. toctree::
22+
:maxdepth: 2
23+
:numbered: 4
24+
25+
Indices and tables
26+
==================
27+
28+
* :ref:`genindex`
29+
* :ref:`modindex`
30+
* :ref:`search`

docs/source/modules.rst

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.. toctree::
2+
:maxdepth: 4
3+
4+
setup

docs/source/setup.rst

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
setup module
2+
============
3+
4+
.. automodule:: setup
5+
:members:
6+
:undoc-members:
7+
:show-inheritance:

requirements.txt

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
toolz==0.10.0
2+
enum34==1.1.6
3+
pint==0.9
4+
strip-hints==0.1.7
5+
sphinx==2.2.0
6+
sphinxcontrib-apidoc==0.3.0

scripts/strip_hints.sh

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/sh
2+
echo "Removing type hints to satisfy Python 3.5"
3+
find ./taurus -regex '.*\.py'|while read fileName; do
4+
echo $fileName
5+
strip-hints $fileName --to-empty --only-assigns-and-defs >tmp.py
6+
mv tmp.py $fileName
7+
done
8+
find ./tests -regex '.*\.py'|while read fileName; do
9+
echo $fileName
10+
strip-hints $fileName --to-empty --only-assigns-and-defs >tmp.py
11+
mv tmp.py $fileName
12+
done

setup.py

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
from setuptools import setup, find_packages
2+
from setuptools.command.install import install
3+
from setuptools.command.develop import develop
4+
import sys
5+
import subprocess
6+
7+
8+
class PostInstallCommand(install):
9+
"""Post-installation for installation mode."""
10+
11+
def run(self):
12+
"""Run strip-hints to support python 3.5.
13+
14+
Python version is constrained to [3.5, 4.0), so if the minor version is < 6,
15+
run the script to strip type hints
16+
"""
17+
if sys.version_info.minor < 6:
18+
subprocess.call('chmod 755 scripts/strip_hints.sh', shell=True)
19+
subprocess.call('./scripts/strip_hints.sh', shell=True)
20+
install.run(self)
21+
22+
23+
class PostDevelopCommand(develop):
24+
"""Post-installation for develop mode."""
25+
26+
def run(self):
27+
"""Run strip-hints to support python 3.5.
28+
29+
Python version is constrained to [3.5, 4.0), so if the minor version is < 6,
30+
run the script to strip type hints
31+
"""
32+
if sys.version_info.minor < 6:
33+
subprocess.call('chmod 755 scripts/strip_hints.sh', shell=True)
34+
subprocess.call('./scripts/strip_hints.sh', shell=True)
35+
develop.run(self)
36+
37+
38+
setup(name='taurus-citrine',
39+
version='0.1.0',
40+
url='http://github.com/CitrineInformatics/taurus',
41+
description='Python library for the Citrine Platform',
42+
author='Max Hutchinson',
43+
author_email='[email protected]',
44+
packages=find_packages(),
45+
package_data={
46+
'taurus': [
47+
'demo/strehlow_and_cook.json',
48+
'units/citrine_en.txt'
49+
]
50+
},
51+
install_requires=[
52+
"toolz",
53+
"pytest>=4.3",
54+
"enum34",
55+
"pint>=0.9",
56+
"strip-hints>=0.1.5"
57+
],
58+
cmdclass={
59+
'install': PostInstallCommand,
60+
'develop': PostDevelopCommand
61+
})

taurus/__init__.py

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

taurus/client/__init__.py

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

0 commit comments

Comments
 (0)