Skip to content

Commit

Permalink
squashing readthedocs commits
Browse files Browse the repository at this point in the history
  • Loading branch information
Christopher JF Cameron authored and Christopher JF Cameron committed Jun 20, 2023
1 parent c4bd940 commit 46d148b
Show file tree
Hide file tree
Showing 19 changed files with 857 additions and 291 deletions.
19 changes: 19 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# .readthedocs.yaml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Set the version of Python and other tools you might need
build:
os: ubuntu-22.04
tools:
python: "mambaforge-4.10"

conda:
environment: docs/environment.yml

# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/conf.py
165 changes: 106 additions & 59 deletions README.md

Large diffs are not rendered by default.

11 changes: 0 additions & 11 deletions conda-build/conda_build_config.yaml

This file was deleted.

19 changes: 9 additions & 10 deletions conda-build/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% set version = "0.0.0" %}
{% set version = "0.1.0" %}

package:
name: repic
Expand Down Expand Up @@ -40,15 +40,14 @@ about:
license_family: BSD
license_file: LICENSE
summary: REPIC - an ensemble learning approach to cryo-EM particle picking.
description: REPIC is an ensemble learning approach to cryogenic-electron\
\ microscopy (cryo-EM) particle picking. It identifies particles common to\
\ multiple picked particle sets (i.e., consensus particles) using graph\
\ theory and integer linear programming (ILP). Picked particle sets may be\
\ found by a human specialist (manual), template matching, mathematical\
\ function (e.g., RELION's Laplacian-of-Gaussian auto-picking), or\
\ machine-learning method. REPIC expects particle sets to be in BOX file\
\ format (*.box) and contain particle coordinates, detection box size (in\
\ pixels), and (optional) score [0-1].
description: REPIC is an ensemble learning approach to cryogenic-electron
microscopy (cryo-EM) particle picking. It identifies particles common to multiple
picked particle sets (i.e., consensus particles) using graph theory and integer
linear programming (ILP). Picked particle sets may be found by a human specialist
(manual), template matching, mathematical function (e.g., RELION's
Laplacian-of-Gaussian auto-picking), or machine-learning method. REPIC expects
particle sets to be in BOX file format (*.box) and contain particle coordinates,
detection box size (in pixels), and (optional) score [0-1].
dev_url: https://github.com/ccameron/REPIC

extra:
Expand Down
75 changes: 75 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# Configuration file for the Sphinx documentation builder.
#
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

import os
import subprocess
import sys

sys.path.insert(0, os.path.abspath('.'))


def convert_readme_to_rest():
"""
Converts GitHub README (MarkDown) to Sphinx reST format
"""
# myst-parser doesn't include titles in toctree nor properly handles images
# steps:
# 1) converts from MarkDown to reST
# 2) remove redundant REPIC header
subprocess.run(["""pandoc ../README.md -f gfm -t rst -s -o readme.rst"""],
shell=True)
# ; perl -i -p0e 's/REPIC\n=====\n\n//se' readme.rst
# update local REPIC schematic image
# steps:
# 1) cp imgs/ to sphinx_docs/
# 2) update overview img reference in readme.rst
# 3) update icon img reference in readme.rst
subprocess.run(["""cp -R ../imgs .;
echo ".. image:: imgs/repic_overview.png
:width: 90%
:alt: REPIC schematic
:align: center
|" > tmp.txt;
perl -i -p0e 's/\.\. raw:: html\n\n <p align=(.|\n)*\.png">\n <\/p>\n/`cat tmp.txt`/se' readme.rst;
echo ".. image:: imgs/repic_icon.png
:width: 25%
:alt: REPIC icon" > tmp.txt;
perl -i -p0e 's/\.\. raw:: html\n\n <img width=.*\.png">\n/`cat tmp.txt`/se' readme.rst;
rm tmp.txt"""],
shell=True)


convert_readme_to_rest()

# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information

project = 'REPIC'
copyright = '2023, Christopher JF Cameron'
author = 'Christopher JF Cameron'
release = '0.0.0'

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

extensions = [
'autoapi.extension',
'sphinx.ext.napoleon'
]
autoapi_dirs = ['../repic']
autoapi_type = "python"

templates_path = ['_templates']
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']


# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output

html_theme = 'sphinx_rtd_theme'
html_theme_options = {
'collapse_navigation': False,
}
html_static_path = ['_static']
15 changes: 15 additions & 0 deletions docs/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: repic
channels:
- bioconda
- conda-forge
- defaults
dependencies:
- python=3.8
- repic
- pandoc
- sphinx==6.2.1
- sphinx_rtd_theme
- sphinx-autoapi
- pip:
- readthedocs-sphinx-search
prefix: /Users/ccameron/miniconda3/envs/repic
13 changes: 13 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Welcome to REPIC's documentation!
=================================

REliable PIcking by Consensus (REPIC) identifies cryogenic electron microscopy
(cryo-EM) particles common to multiple picked particle sets using graph theory
and integer linear programming.

.. toctree::
:maxdepth: 3
:caption: Contents:

readme.rst
autoapi/index.rst
Binary file added imgs/repic_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified imgs/repic_overview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion repic/__version__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/usr/bin/env python3
__version__ = "0.0.0"
__version__ = "0.1.0"
Loading

0 comments on commit 46d148b

Please sign in to comment.