Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix sphinx #201

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:

- name: Install python general dependencies
run: |
pip install wheel future pytest
pip install wheel pytest
pip install numpy
pip install Cython
pip install --no-binary=h5py h5py
Expand All @@ -61,7 +61,7 @@ jobs:
- name: Install dias and doc dependencies
run: |
pip install -r docs/rtd-requirements.txt
pip install sphinx==2.4.4
pip install sphinx

- name: Install dias
run: |
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ instance/

# Sphinx documentation
docs/_build/
docs/api/

# PyBuilder
target/
Expand Down
4 changes: 2 additions & 2 deletions dias/analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ class Analyzer(config.Reader):
will be overridden with instance attributes with the same name but with the
values specified in the config file.

Attributes
----------
Config Attributes
-----------------
period : String
A time period (e.g. '1h'), indicating the schedule for this task
start_time : String
Expand Down
2 changes: 1 addition & 1 deletion dias/analyzers/sensitivity_analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ def run(self):

# Normalize
inv_counter = tools.invert_no_zero(counter)
var *= inv_counter ** 2
var *= inv_counter**2

# Compute metric to be exported
self.sens.labels(pol="EW").set(
Expand Down
2 changes: 1 addition & 1 deletion dias/analyzers/source_spectra_analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ def run(self):
# Normalize
inv_counter = tools.invert_no_zero(counter)
vis *= inv_counter
var *= inv_counter ** 2
var *= inv_counter**2

ra = np.degrees(np.unwrap(ra))
ha = ra - np.degrees(src_ra)
Expand Down
2 changes: 1 addition & 1 deletion dias/utils/string_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
r"((?P<hours>\d+?)h)?((?P<minutes>\d+?)m)?((?P<seconds>\d+?)s)?"
)
DATETIME_FORMAT = "%Y-%m-%d %H:%M:%S"
DATA_UNITS = {"B": 1, "kB": 10 ** 3, "MB": 10 ** 6, "GB": 10 ** 9}
DATA_UNITS = {"B": 1, "kB": 10**3, "MB": 10**6, "GB": 10**9}
DATA_UNITS_SORTED = ["B", "kB", "MB", "GB"]


Expand Down
10 changes: 7 additions & 3 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@
"""Configuration file for the Sphinx documentation builder."""
from recommonmark.parser import CommonMarkParser

import os
import sys

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

# Mock imports

import sys
from unittest.mock import MagicMock


Expand All @@ -23,7 +27,7 @@ def __getattr__(cls, name): # noqa

project = "dias"
copyright = "2019, The CHIME Collaboration"
author = "Donald Wiebe and Rick Nitsche"
author = "The CHIME Collaboration"

# The short X.Y version
version = ""
Expand All @@ -35,7 +39,7 @@ def __getattr__(cls, name): # noqa

autoclass_content = "both" # include both class docstring and __init__
autodoc_warningiserror = True
autosummary_generate = True # Make _autosummary files and include them
autosummary_generate = False # Make _autosummary files and include them
napoleon_use_rtype = False # More legible

# Add any Sphinx extension module names here, as strings. They can be
Expand Down
1 change: 1 addition & 0 deletions docs/rtd-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# From install_requires
chimedb.data_index @ git+https://github.com/chime-experiment/chimedb_di.git
caput @ git+https://github.com/radiocosmology/caput.git
draco @ git+https://github.com/radiocosmology/draco.git
prometheus_client>=0.5.0
bitshuffle
pyyaml
Expand Down
10 changes: 0 additions & 10 deletions docs/user/analyzers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ listed here.

.. autosummary::
:template: baseanalyzer_user.rst
:toctree: _autosummary

Analyzer

Expand All @@ -17,71 +16,62 @@ listed here.

.. autosummary::
:template: analyzer_user.rst
:toctree: _autosummary

FeedpositionsAnalyzer

.. currentmodule:: dias.analyzers.thermaldata_analyzer

.. autosummary::
:template: analyzer_user.rst
:toctree: _autosummary

ThermalDataAnalyzer

.. currentmodule:: dias.analyzers.find_jump_analyzer

.. autosummary::
:template: analyzer_user.rst
:toctree: _autosummary

FindJumpAnalyzer

.. currentmodule:: dias.analyzers.flag_rfi_analyzer

.. autosummary::
:template: analyzer_user.rst
:toctree: _autosummary

FlagRFIAnalyzer

.. currentmodule:: dias.analyzers.sensitivity_analyzer

.. autosummary::
:template: analyzer_user.rst
:toctree: _autosummary

SensitivityAnalyzer

.. currentmodule:: dias.analyzers.daily_ringmaps

.. autosummary::
:template: analyzer_user.rst
:toctree: _autosummary

DailyRingmapAnalyzer

.. currentmodule:: dias.analyzers.source_spectra_analyzer

.. autosummary::
:template: analyzer_user.rst
:toctree: _autosummary

SourceSpectraAnalyzer

.. currentmodule:: dias.analyzers.test_analyzer

.. autosummary::
:template: analyzer_user.rst
:toctree: _autosummary

TestAnalyzer

.. currentmodule:: dias.analyzers.sample_analyzer

.. autosummary::
:template: analyzer_user.rst
:toctree: _autosummary

SampleAnalyzer

Expand Down