Skip to content

Commit

Permalink
Merge branch 'main' into add_mcc
Browse files Browse the repository at this point in the history
  • Loading branch information
amrit110 authored Feb 11, 2024
2 parents 2834deb + 1bf5eb2 commit 6262b31
Show file tree
Hide file tree
Showing 46 changed files with 971 additions and 969 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ repos:
- id: black

- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: 'v0.1.7'
rev: 'v0.2.1'
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
Expand All @@ -45,7 +45,7 @@ repos:
exclude: ^docs/source/tutorials/gemini/.*\.ipynb$

- repo: https://github.com/nbQA-dev/nbQA
rev: 1.7.0
rev: 1.7.1
hooks:
- id: nbqa-black
- id: nbqa-ruff
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ guidelines.

## 📚 [Documentation](https://vectorinstitute.github.io/cyclops/)

If you need to build the documentations locally, make sure to install ``Pandoc`` in addition to ``docs`` poetry group.


## 📓 Notebooks

Expand Down
2 changes: 1 addition & 1 deletion cyclops/models/catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ def create_model(
An instance of the model.
"""
model_class = _model_catalog.get(model_name, None)
model_class = _model_catalog.get(model_name)
if model_class is None:
if model_name == "xgb_classifier":
raise RuntimeError(_xgboost_unavailable_message)
Expand Down
50 changes: 50 additions & 0 deletions docs/source/_static/css/cyclops.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
footer span.commit code,
.rst-content pre.literal-block,
.rst-content div[class^='highlight'] pre,
.rst-content .linenodiv pre,
.rst-content tt,
.rst-content code,
.rst-content pre,
.rst-content kbd,
.rst-content samp {
font-family: 'IBM Plex Mono', monospace;
font-size: 0.8rem;
}

footer {
color: var(--text-color);
}
footer .footer-small-text {
font-weight: 300;
font-size: 0.9rem;
}
footer .copyright {
font-weight: 300;
font-size: 0.8rem;
}
footer div.logo {
display: flex;
flex-wrap: wrap;
justify-content: space-around;
margin: 0px;
padding: 10px 0px 0px 0px;
}
footer a.logo {
/* Using flex here (to vertically align the child img) causes aspect-ratio issues */
flex-basis: 120px;
margin: 10px auto 10px auto;
text-align: center;
}
footer a.logo:hover {
text-decoration: none;
}
footer span.logo {
display: inline-block;
height: 100%;
vertical-align: middle;
}
footer img.logo {
display: inline-block;
vertical-align: middle;
height: auto;
}
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
26 changes: 26 additions & 0 deletions docs/source/_templates/sections/footer.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{% block extrafooter %}

<div class="footer-container" style="text-align: center;">
<div class="footer-small-text">
<br> All <a href="https://github.com/VectorInstitute/cyclops">source code for cyclops</a> is freely available under the terms of an <a href="https://opensource.org/licenses/Apache-2.0">Apache-2.0</a> license.
</div>

<div class="footer-small-text">
This work is made possible due to the data obtained from the <a href="https://www.geminimedicine.ca/">GEMINI study</a>.
</div>

<hr/>

<div class="logo">
<a class="logo" href="https://vectorinstitute.ai/">
<span class="logo"></span>
<img alt="Logo of the Vector Institute" style="width:90px; max-width:90px;" src="{{ pathto('_static/logos/vector_logo.png', 1) }}" />
</a>
<a class="logo" href="https://www.geminimedicine.ca/">
<span class="logo"></span>
<img alt="Logo of GEMINI" style="width:90px; max-width:90px;" src="{{ pathto('_static/logos/gemini_logo.png', 1) }}" />
</a>
</div>
</div>

{% endblock %}
6 changes: 5 additions & 1 deletion docs/source/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@ API Reference
=============

.. toctree::
:maxdepth: 1
:glob:

reference/api/cyclops.data.rst
reference/api/cyclops.tasks.rst
reference/api/cyclops.evaluate.rst
reference/api/evaluator.rst
reference/api/fairness_evaluator.rst
reference/api/metrics.rst
reference/api/cyclops.monitor.rst
reference/api/cyclops.report.rst
21 changes: 19 additions & 2 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,14 @@
copybutton_prompt_text = r">>> |\.\.\. "
copybutton_prompt_is_regexp = True

html_theme_options = {
"collapse_navigation": False,
"sticky_navigation": True,
"navigation_depth": 4,
"includehidden": True,
"titles_only": False,
}

intersphinx_mapping = {
"python": ("https://docs.python.org/3.9/", None),
"numpy": ("http://docs.scipy.org/doc/numpy/", None),
Expand All @@ -84,10 +92,19 @@
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = "theme"
html_theme_path = ["."]
html_theme = "sphinx_book_theme"

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ["_static"]
html_css_files = ["css/cyclops.css"]
html_logo = "_static/cyclops_logo-dark.png"
html_favicon = "_static/favicon.ico"
html_theme_options = {
"logo": { # type: ignore
"text": "cyclops documentation",
"image_light": "_static/cyclops_logo-dark.png",
"image_dark": "_static/cyclops_logo-dark.png",
},
}
34 changes: 34 additions & 0 deletions docs/source/developing.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
🧑🏿‍💻 Developing
=======================

Using poetry
------------

The development environment can be set up using `poetry <https://python-poetry.org/docs/#installation>`__. Hence, make sure it is installed and then run:

.. code:: bash
python3 -m poetry install
source $(poetry env info --path)/bin/activate
In order to install dependencies for testing (codestyle, unit tests, integration tests), run:

.. code:: bash
python3 -m poetry install --with test
API documentation is built using `Sphinx <https://www.sphinx-doc.org/en/master/>`__ and can be locally built by:

.. code:: bash
python3 -m poetry install --with docs
cd docs
make html SPHINXOPTS="-D nbsphinx_allow_errors=True"
If you need to build the documentations locally, make sure to install ``Pandoc`` in addition to ``docs`` poetry group.

Contributing
------------

Contributing to cyclops is welcomed. See `Contributing <https://vectorinstitute.github.io/cyclops/api/contributing.html>`__ for guidelines.
2 changes: 2 additions & 0 deletions docs/source/evaluation.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Evaluation
==========
5 changes: 3 additions & 2 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ Welcome to cyclops's documentation!
:maxdepth: 2
:caption: Contents:

intro
contributing
user_guide
tutorials
developing
contributing
api
29 changes: 29 additions & 0 deletions docs/source/installation.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
Installation
============

Using pip
---------

.. code:: bash
python3 -m pip install pycyclops
``cyclops`` has many optional dependencies that are used for specific functionality. For example, the `monai <https://github.com/Project-MONAI/MONAI>`__ library is used for loading DICOM images to create datasets. All optional dependencies can be installed with ``pycyclops[all]``, and specific sets of dependencies are listed in the sections below.

+-----------------------------+--------------------------+---------------------------------------------------------------------------------------------------------------+
| Dependency | pip extra | Notes |
+=============================+==========================+===============================================================================================================+
| xgboost | xgboost | Allows use of `XGBoost <https://xgboost.readthedocs.io/en/stable/>`__ model |
+-----------------------------+--------------------------+---------------------------------------------------------------------------------------------------------------+
| torch | torch | Allows use of `PyTorch <https://pytorch.org/>`__ models |
+-----------------------------+--------------------------+---------------------------------------------------------------------------------------------------------------+
| torchvision | torchvision | Allows use of `Torchvision <https://pytorch.org/vision/stable/index.html>`__ library |
+-----------------------------+--------------------------+---------------------------------------------------------------------------------------------------------------+
| torchxrayvision | torchxrayvision | Uses `TorchXRayVision <https://mlmed.org/torchxrayvision/>`__ library |
+-----------------------------+--------------------------+---------------------------------------------------------------------------------------------------------------+
| monai | monai | Uses `MONAI <https://github.com/Project-MONAI/MONAI>`__ to load and transform images |
+-----------------------------+--------------------------+---------------------------------------------------------------------------------------------------------------+
| alibi | alibi | Uses `Alibi <https://docs.seldon.io/projects/alibi/en/stable/>`__ for additional explainability functionality |
+-----------------------------+--------------------------+---------------------------------------------------------------------------------------------------------------+
| alibi-detect | alibi-detect | Uses `Alibi Detect <https://docs.seldon.io/projects/alibi-detect/en/stable/>`__ for dataset shift detection |
+-----------------------------+--------------------------+---------------------------------------------------------------------------------------------------------------+
130 changes: 0 additions & 130 deletions docs/source/intro.rst

This file was deleted.

2 changes: 2 additions & 0 deletions docs/source/model_report.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Model Report
============
2 changes: 2 additions & 0 deletions docs/source/monitoring.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Monitoring
==========
Loading

0 comments on commit 6262b31

Please sign in to comment.