Skip to content

Commit

Permalink
Merge pull request #148 from ChihweiLHBird/docs_branch
Browse files Browse the repository at this point in the history
Update And Test Documents on Readthedoc
  • Loading branch information
rgerkin committed Jun 12, 2020
2 parents 0bf6f2e + 69f992a commit 427e484
Show file tree
Hide file tree
Showing 11 changed files with 510 additions and 87 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
| Master | Dev |
| ------------- | ------------- |
| [![Travis](https://travis-ci.org/scidash/sciunit.svg?branch=master)](https://travis-ci.org/scidash/sciunit) | [![Travis](https://travis-ci.org/scidash/sciunit.svg?branch=dev)](https://travis-ci.org/scidash/sciunit) |
| [![Travis](https://img.shields.io/travis/scidash/sciunit/master.svg?x=1)](https://travis-ci.org/scidash/sciunit) | [![Travis](https://travis-ci.org/scidash/sciunit.svg?branch=dev)](https://travis-ci.org/scidash/sciunit) |
| [![RTFD](https://readthedocs.org/projects/sciunit/badge/?version=master)](http://sciunit.readthedocs.io/en/latest/?badge=master) | [![RTFD](https://readthedocs.org/projects/sciunit/badge/?version=dev)](http://sciunit.readthedocs.io/en/latest/?badge=dev) |
| [![Binder](https://mybinder.org/badge.svg)](https://mybinder.org/v2/gh/scidash/sciunit/master?filepath=docs%2Fchapter1.ipynb) | |
| [![Coveralls](https://coveralls.io/repos/github/scidash/sciunit/badge.svg?branch=master)](https://coveralls.io/github/scidash/sciunit?branch=master) | [![Coveralls](https://coveralls.io/repos/github/scidash/sciunit/badge.svg?branch=dev)](https://coveralls.io/github/scidash/sciunit?branch=dev) |
| [![Coveralls](https://coveralls.io/repos/github/scidash/sciunit/badge.svg?branch=master)](https://coveralls.io/github/scidash/sciunit?branch=master) | [![Coveralls](https://coveralls.io/repos/github/scidash/sciunit/badge.svg?branch=dev&x=1)](https://coveralls.io/github/scidash/sciunit?branch=dev) |
| [![Requirements](https://requires.io/github/scidash/sciunit/requirements.svg?branch=master)](https://requires.io/github/scidash/sciunit/requirements/?branch=master) | [![Requirements](https://requires.io/github/scidash/sciunit/requirements.svg?branch=dev)](https://requires.io/github/scidash/sciunit/requirements/?branch=dev) |
| [![Docker Build Status](https://img.shields.io/docker/build/scidash/sciunit.svg)](https://hub.docker.com/r/scidash/sciunit/builds/) |
| [![Repos using Sciunit](https://img.shields.io/librariesio/dependent-repos/pypi/sciunit.svg)](https://github.com/scidash/sciunit/network/dependents?dependent_type=REPOSITORY)
Expand Down
121 changes: 121 additions & 0 deletions docs/source/basics.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
SciUnit basics
==============

This page will give you a basic view of the SciUnit project,
and you can read the quick tutorials for some simple examples.

The major parts of SciUnit are Score, Test, and Model.

Model
------

``Model`` is the abstract base class for sciunit models. Generally, a model instance can
generate predicted or simulated results of some scientific fact.


Runnable Model

``Runnable model`` is a kind of model that implements Runnable
capability, and it can be executed to simulate and output results.


Backend

After being registered by ``register_backends`` function, a ``Backend`` instance
can be executed by a Ruunable Model at the back end. It usually does some background
computing for the runnable model.


Score
------

``Score`` is the abstract base class for scores. The instance of it (or its subclass) can give some types of
results for test and/or test suite against the models.

The complete scores type in SciUnit are ``BooleanScore``, ``ZScore``, ``CohenDScore``,
``RatioScore``, ``PercentScore``, and ``FloatScore``.

Each type of score has their own features and advantage.

There are also incomplete score types. These type does not contain any
information regarding how good the model is, but the existing of them means there are
some issues during testing or computing process. They are ``NoneScore``, ``TBDScore``, ``NAScore``,
and ``InsufficientDataScore``



ScoreArray, ScoreArrayM2M

Can be used like this, assuming n tests and m models:

>>> sm[test]
(score_1, ..., score_m)

>>> sm[model]
(score_1, ..., score_n)


``ScoreArray`` represents an array of scores derived from a test suite.
Extends the pandas Series such that items are either
models subject to a test or tests taken by a model.
Also displays and computes score summaries in sciunit-specific ways.

``ScoreArrayM2M`` represents an array of scores derived from ``TestM2M``.
Extends the pandas Series such that items are either
models subject to a test or the test itself.

ScoreMatrix, ScoreMatrixM2M

Can be used like this, assuming n tests and m models:

>>> sm[test]
(score_1, ..., score_m)

>>> sm[model]
(score_1, ..., score_n)


``ScoreMatrix`` represents a matrix of scores derived from a test suite.
Extends the pandas DataFrame such that tests are columns and models
are the index. Also displays and compute score summaries in sciunit-specific ways.

``ScoreMatrixM2M`` represents a matrix of scores derived from ``TestM2M``.
Extends the pandas DataFrame such that models/observation are both
columns and the index.


Test, TestM2M
--------------

``Test`` is a abstract base class for tests.

``TestM2M`` is an abstract class for handling tests involving multiple models.

A test instance contains some observations which are considered as the fact.
The test instance can test the model by comparing the predictions with the observations
and generate a specific type of score.

Enables comparison of model to model predictions, and also against
experimental reference data (optional).

Note: ``TestM2M`` would typically be used when handling mutliple (>2)
models, with/without experimental reference data. For single model
tests, you can use the 'Test' class.

TestSuite
----------

A collection of tests. The instance of ``TestSuite`` can perform similar things that a test instance can do.

Converter
----------

A ``Converter`` instance can be used to convert a score between two types.
It can be included in a test instance.

Capability
-----------

``Capability`` is the abstract base class for sciunit capabilities.
A capability instance can be included in a test instance to ensure the
model, which is tested by the test instance, implements some methods.
57 changes: 22 additions & 35 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Welcome to sciunit's documentation!

.. figure:: https://raw.githubusercontent.com/scidash/assets/master/logos/SciUnit/sci-unit-square-small.png
:align: center

=======================================================================================

Concept
Expand All @@ -20,16 +21,16 @@ Concept
`The conference
paper <https://github.com/cyrus-/papers/raw/master/sciunit-icse14/sciunit-icse14.pdf>`__

Documentation
-------------
Tutorials With Jupyter NoteBook
-------------------------------

`Chapter
1 <https://github.com/scidash/sciunit/blob/master/docs/chapter1.ipynb>`__
/ `Chapter
2 <https://github.com/scidash/sciunit/blob/master/docs/chapter2.ipynb>`__
/ `Chapter
3 <https://github.com/scidash/sciunit/blob/master/docs/chapter3.ipynb>`__
/
* `Tutorial Chapter 1`_
* `Tutorial Chapter 2`_
* `Tutorial Chapter 3`_

.. _Tutorial Chapter 1: https://github.com/scidash/sciunit/blob/master/docs/chapter1.ipynb
.. _Tutorial Chapter 2: https://github.com/scidash/sciunit/blob/master/docs/chapter2.ipynb
.. _Tutorial Chapter 3: https://github.com/scidash/sciunit/blob/master/docs/chapter3.ipynb

Basic Usage
-----------
Expand Down Expand Up @@ -75,33 +76,19 @@ SciUnit is released under the permissive `MIT
license <https://opensource.org/licenses/MIT>`__, requiring only
attribution in derivative works. See the LICENSE file for terms.

.. |Travis| image:: https://travis-ci.org/scidash/sciunit.svg?branch=master
:target: https://travis-ci.org/scidash/sciunit
.. |Travis| image:: https://travis-ci.org/scidash/sciunit.svg?branch=dev
:target: https://travis-ci.org/scidash/sciunit
.. |RTFD| image:: https://readthedocs.org/projects/sciunit/badge/?version=master
:target: http://sciunit.readthedocs.io/en/latest/?badge=master
.. |RTFD| image:: https://readthedocs.org/projects/sciunit/badge/?version=dev
:target: http://sciunit.readthedocs.io/en/latest/?badge=dev
.. |Binder| image:: https://mybinder.org/badge.svg
:target: https://mybinder.org/v2/gh/scidash/sciunit/master?filepath=docs%2Fchapter1.ipynb
.. |Coveralls| image:: https://coveralls.io/repos/github/scidash/sciunit/badge.svg?branch=master
:target: https://coveralls.io/github/scidash/sciunit?branch=master
.. |Coveralls| image:: https://coveralls.io/repos/github/scidash/sciunit/badge.svg?branch=dev
:target: https://coveralls.io/github/scidash/sciunit?branch=dev
.. |Requirements| image:: https://requires.io/github/scidash/sciunit/requirements.svg?branch=master
:target: https://requires.io/github/scidash/sciunit/requirements/?branch=master
.. |Requirements| image:: https://requires.io/github/scidash/sciunit/requirements.svg?branch=dev
:target: https://requires.io/github/scidash/sciunit/requirements/?branch=dev
.. |Docker Build Status| image:: https://img.shields.io/docker/build/scidash/sciunit.svg
:target: https://hub.docker.com/r/scidash/sciunit/builds/
.. |Repos using Sciunit| image:: https://img.shields.io/librariesio/dependent-repos/pypi/sciunit.svg
:target: https://github.com/scidash/sciunit/network/dependents?dependent_type=REPOSITORY


Indices and tables
==================
API documentation
------------------

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`


Table of Contents
-----------------

.. toctree::

setup
quick_tutorial
basics

0 comments on commit 427e484

Please sign in to comment.