Skip to content

Commit

Permalink
CAT 0.9.2 (#123)
Browse files Browse the repository at this point in the history
* Updated the Data-CAT documentation (see nlesc-nano/data-CAT#23).
* Upped the minimum Sphinx version to 2.1.
* Removed ``sphinx-autodoc-typehints``.
* Removed ``requirements.txt`` in favor of ``.readthedocs.yml``.
  • Loading branch information
BvB93 authored Jun 10, 2020
1 parent 252c885 commit 7adb1c0
Show file tree
Hide file tree
Showing 9 changed files with 92 additions and 164 deletions.
21 changes: 21 additions & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# .readthedocs.yml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/conf.py

# Optionally build your docs in additional formats such as PDF
formats: all

# Optionally set the version of Python and requirements required to build your docs
python:
install:
- method: pip
path: .
extra_requirements:
- doc
2 changes: 1 addition & 1 deletion CAT/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '0.9.1'
__version__ = '0.9.2'
2 changes: 1 addition & 1 deletion CAT/jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
import numpy as np

from scm.plams.core.basejob import Job
from scm.plams import (Molecule, Settings, Results, config, add_to_class, ResultsError,
from scm.plams import (Molecule, Settings, Results, config, add_to_class, ResultsError,
ADFJob, AMSJob, Units, Cp2kResults)

import qmflows
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@ This project adheres to `Semantic Versioning <http://semver.org/>`_.
* WiP: Added an option the import pre-built quantum dots.


0.9.2
*****
* Updated the Database documentation (see https://github.com/nlesc-nano/data-CAT/pull/23).
* Upped the minimum Sphinx version to 2.1.
* Removed ``sphinx-autodoc-typehints``.
* Removed ``requirements.txt`` in favor of ``.readthedocs.yml``.


0.9.1
*****
* Added a new conceptual DFT (CDFT) workflow to Nano-CAT
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@


##############################
Compound Attachment Tool 0.9.1
Compound Attachment Tool 0.9.2
##############################

**CAT** is a collection of tools designed for the construction of various chemical compounds.
Expand Down
186 changes: 45 additions & 141 deletions docs/7_database.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

The Database Class
==================
.. currentmodule:: dataCAT

A Class designed for the storing, retrieval and updating of results.


.. image:: _images/Database.png
:scale: 35 %
:align: center
Expand All @@ -16,175 +16,79 @@ accoring to their functionality:
- Opening & closing the database - these methods serve as context managers
for loading and unloading parts of the database from the harddrive.

The context managers can be accessed via the :meth:`.MetaManager.open`
method of :attr:`.Database.csv_lig`, :attr:`.Database.csv_qd`,
The context managers can be accessed by calling
either :attr:`.Database.csv_lig`, :attr:`.Database.csv_qd`,
:attr:`.Database.yaml` or :attr:`.Database.hdf5`, with the option
of passing additional positional or keyword arguments.

.. code:: python
>>> import CAT
>>> from dataCAT import Database
>>> database = CAT.Database()
>>> with database.csv_lig.open(write=False) as db:
>>> database = Database()
>>> with database.csv_lig(write=False) as db:
>>> print(repr(db))
DFCollection(df=<pandas.core.frame.DataFrame at 0x7ff8e958ce80>)
DFProxy(ndframe=<pandas.core.frame.DataFrame at 0x7ff8e958ce80>)
>>> with database.yaml.open() as db:
>>> with database.yaml() as db:
>>> print(type(db))
<class 'scm.plams.core.settings.Settings'>
>>> with database.hdf5.open('r') as db:
>>> with database.hdf5('r') as db:
>>> print(type(db))
<class 'h5py._hl.files.File'>
- Importing to the database - these methods handle the importing of new data
from python objects to the Database class:

=================== ==================== ==================== =======================
:meth:`.update_csv` :meth:`.update_yaml` :meth:`.update_hdf5` :meth:`.update_mongodb`
=================== ==================== ==================== =======================
============================ ============================= ============================= ================================
:meth:`~Database.update_csv` :meth:`~Database.update_yaml` :meth:`~Database.update_hdf5` :meth:`~Database.update_mongodb`
============================ ============================= ============================= ================================

- Exporting from the database - these methods handle the exporting of data
from the Database class to other python objects or remote locations:

================= ==================
:meth:`.from_csv` :meth:`.from_hdf5`
================= ==================
========================== ===========================
:meth:`~Database.from_csv` :meth:`~Database.from_hdf5`
========================== ===========================


Index
-----

.. currentmodule:: dataCAT.database.Database
.. autosummary::

dirname
csv_lig
csv_qd
hdf5
yaml
mongodb

update_mongodb
update_csv
update_yaml
update_hdf5
from_csv
from_hdf5

.. currentmodule:: dataCAT
.. autosummary::

df_collection.get_df_collection
database_functions.as_pdb_array
database_functions.from_pdb_array
database_functions.sanitize_yaml_settings


Class API
---------

Database
~~~~~~~~

.. autoclass:: dataCAT.database.Database
:members:


DFCollection
~~~~~~~~~~~~

.. autoclass:: dataCAT.df_collection._DFCollection
Database.dirname
Database.csv_lig
Database.csv_qd
Database.hdf5
Database.yaml
Database.mongodb

Database.update_mongodb
Database.update_csv
Database.update_yaml
Database.update_hdf5
Database.from_csv
Database.from_hdf5

DFProxy
OpenLig
OpenQD
OpenYaml


API
---
.. autoclass:: Database
:members:


MetaManager
~~~~~~~~~~~

.. autoclass:: dataCAT.context_managers.MetaManager
.. autoclass:: DFProxy
.. autoclass:: OpenLig
:members:


OpenLig
~~~~~~~

.. autoclass:: dataCAT.context_managers.OpenLig
:inherited-members:
.. autoclass:: OpenQD
:members:


OpenQD
~~~~~~

.. autoclass:: dataCAT.context_managers.OpenQD
:inherited-members:
.. autoclass:: OpenYaml
:members:


OpenYaml
~~~~~~~~

.. autoclass:: dataCAT.context_managers.OpenYaml
:members:


Function API
------------

.. autofunction:: dataCAT.df_collection.get_df_collection

.. autofunction:: dataCAT.database_functions.as_pdb_array

.. autofunction:: dataCAT.database_functions.from_pdb_array

.. autofunction:: dataCAT.database_functions.sanitize_yaml_settings


.. _dataCAT.DFCollection: 7_database.html#dfcollection
.. _dataCAT.MetaManager: 7_database.html#metamanager
.. _rdkit.Chem.Mol: http://rdkit.org/docs/source/rdkit.Chem.rdchem.html#rdkit.Chem.rdchem.Mol
.. _h5py.File: http://docs.h5py.org/en/stable/high/file.html
.. _plams.Settings: https://www.scm.com/doc/plams/components/settings.html
.. _plams.Molecule: https://www.scm.com/doc/plams/components/molecule.html#id1
.. _np.ndarray: https://docs.scipy.org/doc/numpy/reference/generated/numpy.ndarray.html
.. _np.float64: https://docs.scipy.org/doc/numpy/user/basics.types.html#array-types-and-conversions-between-types
.. _np.int64: https://docs.scipy.org/doc/numpy/user/basics.types.html#array-types-and-conversions-between-types
.. _np.str_: https://docs.scipy.org/doc/numpy/reference/arrays.dtypes.html#arrays-dtypes
.. _np.bytes: https://docs.scipy.org/doc/numpy-1.15.1/reference/arrays.dtypes.html
.. _pd.Series: https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Series.html
.. _pd.DataFrame: https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.html
.. _dict: https://docs.python.org/3/library/stdtypes.html#dict
.. _list: https://docs.python.org/3/library/stdtypes.html#list
.. _tuple: https://docs.python.org/3/library/stdtypes.html#tuple
.. _str: https://docs.python.org/3/library/stdtypes.html#str
.. _int: https://docs.python.org/3/library/functions.html#int
.. _None: https://docs.python.org/3.7/library/constants.html#None
.. _bool: https://docs.python.org/3/library/functions.html?highlight=bool#bool
.. _with: https://docs.python.org/3/reference/compound_stmts.html#with
.. _type: https://docs.python.org/3/library/functions.html#type
.. _Sequence: https://docs.python.org/3/library/collections.abc.html#collections.abc.Sequence
.. _AbstractContextManager: https://docs.python.org/3/library/contextlib.html#contextlib.AbstractContextManager

.. |dataCAT.DFCollection| replace:: *dataCAT.DFCollection*
.. |dataCAT.MetaManager| replace:: *dataCAT.MetaManager*
.. |rdkit.Chem.Mol| replace:: *rdkit.Chem.Mol*
.. |h5py.File| replace:: *h5py.File*
.. |plams.Molecule| replace:: *plams.Molecule*
.. |plams.Settings| replace:: *plams.Settings*
.. |pd.Series| replace:: *pd.Series*
.. |pd.DataFrame| replace:: *pd.DataFrame*
.. |np.ndarray| replace:: *np.ndarray*
.. |np.float64| replace:: *np.float64*
.. |np.int64| replace:: *np.int64*
.. |np.str_| replace:: *np.str_*
.. |np.bytes| replace:: *np.bytes*
.. |dict| replace:: *dict*
.. |list| replace:: *list*
.. |tuple| replace:: *tuple*
.. |str| replace:: *str*
.. |int| replace:: *int*
.. |None| replace:: *None*
.. |bool| replace:: *bool*
.. |with| replace:: ``with``
.. |type| replace:: *type*
.. |Sequence| replace:: *Sequence*
.. |AbstractContextManager| replace:: *AbstractContextManager*
:inherited-members:
21 changes: 14 additions & 7 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
# -- General configuration ------------------------------------------------

# If your documentation needs a minimal Sphinx version, state it here.
needs_sphinx = '2.0' # 2.0 or higher
needs_sphinx = '2.1'


# Output is processed with HTML4 writer.
Expand All @@ -42,11 +42,17 @@
'sphinx.ext.mathjax',
'sphinx.ext.viewcode',
'sphinx.ext.autosummary',
'sphinx.ext.napoleon',
'sphinx_autodoc_typehints'
'sphinx.ext.napoleon'
]


# This value controls how to represents typehints. The setting takes the following values:
# 'signature' – Show typehints as its signature (default)
# 'none' – Do not show typehints
# New in version 2.1.
autodoc_typehints = 'none'


# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

Expand All @@ -62,14 +68,14 @@

# General information about the project.
project = 'CAT'
year = str(datetime.datetime.now().year)
_year = str(datetime.datetime.now().year)
author = 'B. F. van Beek & J. Belic'
copyright = f'{year}, {author}'
copyright = f'{_year}, {author}'


# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the built documents.
release = '0.9.1' # The full version, including alpha/beta/rc tags.
release = '0.9.2' # The full version, including alpha/beta/rc tags.
version = release.rsplit('.', maxsplit=1)[0]


Expand Down Expand Up @@ -204,7 +210,8 @@
'plams': ('https://www.scm.com/doc/plams/', None),
'qmflows': ('https://qmflows.readthedocs.io/en/latest/', None),
'FOX': ('https://auto-fox.readthedocs.io/en/latest/', None),
'scipy': ('https://docs.scipy.org/doc/scipy/reference', None)
'scipy': ('https://docs.scipy.org/doc/scipy/reference', None),
'pymongo': ('https://pymongo.readthedocs.io/en/stable/', None)
}


Expand Down
12 changes: 0 additions & 12 deletions requirements.txt

This file was deleted.

2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,6 @@
'pycodestyle',
'data-CAT@git+https://github.com/nlesc-nano/data-CAT@devel',
'nano-CAT@git+https://github.com/nlesc-nano/nano-CAT@devel'],
'doc': ['sphinx>=2.0', 'sphinx_rtd_theme', 'sphinx-autodoc-typehints']
'doc': ['sphinx>=2.1', 'sphinx_rtd_theme']
}
)

0 comments on commit 7adb1c0

Please sign in to comment.