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

Refactor formatting #56

Merged
merged 5 commits into from
Jun 25, 2024
Merged
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
51 changes: 26 additions & 25 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,58 +12,59 @@
# documentation root, use os.path.abspath to make it absolute, like shown here.
#

from pathlib import Path
import sys
from pathlib import Path

import mrtool

base_dir = Path(mrtool.__file__).parent

about = {}
with (base_dir / '__about__.py').open() as f:
with (base_dir / "__about__.py").open() as f:
exec(f.read(), about)

sys.path.insert(0, Path('..').resolve())
sys.path.insert(0, Path("..").resolve())


# -- Project information -----------------------------------------------------

project = about['__title__']
project = about["__title__"]
copyright = f"2020, {about['__author__']}"
author = about['__author__']
author = about["__author__"]

# The short X.Y version.
version = about['__version__']
version = about["__version__"]
# The full version, including alpha/beta/rc tags.
release = about['__version__']
release = about["__version__"]

# -- General configuration ---------------------------------------------------

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.

needs_sphinx = '1.5'
needs_sphinx = "1.5"

extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.intersphinx',
'sphinx.ext.doctest',
'sphinx.ext.todo',
'sphinx.ext.coverage',
'sphinx.ext.mathjax',
'sphinx.ext.napoleon',
'sphinx.ext.viewcode',
'sphinx_autodoc_typehints',
'matplotlib.sphinxext.plot_directive',
"sphinx.ext.autodoc",
"sphinx.ext.intersphinx",
"sphinx.ext.doctest",
"sphinx.ext.todo",
"sphinx.ext.coverage",
"sphinx.ext.mathjax",
"sphinx.ext.napoleon",
"sphinx.ext.viewcode",
"sphinx_autodoc_typehints",
"matplotlib.sphinxext.plot_directive",
]

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

source_suffix = '.rst'
master_doc = 'index'
source_suffix = ".rst"
master_doc = "index"

# List of patterns, relative to source directory, that match files and
# list of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = []
Expand All @@ -74,14 +75,14 @@
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'sphinx_rtd_theme'
html_theme = "sphinx_rtd_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_static_path = ["_static"]
html_css_files = [
'css/custom.css',
"css/custom.css",
]

add_module_names = False
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ license = { file = "LICENSE" }
authors = [
{ name = "IHME Math Sciences", email = "[email protected]" },
]
dependencies = ["numpy", "pandas", "scipy", "xspline<0.1.0", "xarray", "limetr<0.1.0"]
dependencies = ["numpy", "pandas", "scipy", "xspline<0.1.0", "xarray", "limetr<0.1.0", "matplotlib"]

[project.optional-dependencies]
dev = ["pytest", "pytest-mock"]
Expand Down
8 changes: 8 additions & 0 deletions ruff.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
line-length = 80
src = ["src"]

[format]
docstring-code-format = true

[lint.pydocstyle]
convention = "numpy"
22 changes: 17 additions & 5 deletions src/mrtool/__init__.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,24 @@
# -*- coding: utf-8 -*-
"""
mrtool
~~~~~~
mrtool
~~~~~~

`mrtool` package.
`mrtool` package.
"""
from .core.data import MRData

from .core import utils
from .core.cov_model import CovModel, LinearCovModel, LogCovModel
from .core.data import MRData
from .core.model import MRBRT, MRBeRT
from .core import utils
from .cov_selection.covfinder import CovFinder

__all__ = [
"MRData",
"CovModel",
"LinearCovModel",
"LogCovModel",
"MRBRT",
"MRBeRT",
"utils",
"CovFinder",
]
Loading
Loading