Skip to content

Commit

Permalink
fixed linting and docs
Browse files Browse the repository at this point in the history
  • Loading branch information
KapilDuwadi committed Jun 5, 2024
1 parent 52d5c77 commit b15b2e1
Show file tree
Hide file tree
Showing 66 changed files with 1,303 additions and 1,645 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ __pycache__/
*.py[cod]
*$py.class


env
.vscode/

# C extensions
Expand Down
10 changes: 10 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.1.8
hooks:
# Run the linter.
- id: ruff
args: [--fix]
# Run the formatter.
- id: ruff-format
20 changes: 20 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
BUILDDIR = _build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
File renamed without changes
7 changes: 7 additions & 0 deletions docs/api/der-scenario.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
========
Scenario
========

.. autofunction:: emerge.scenarios.scenario.create_der_scenarios

.. autofunction:: emerge.scenarios.scenario.generate_scenarios
12 changes: 12 additions & 0 deletions docs/api/enumerations.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
============
Enumerations
============

.. autoclass:: emerge.scenarios.data_model.DERType
:members:

.. autoclass:: emerge.scenarios.data_model.CapacityStrategyEnum
:members:

.. autoclass:: emerge.scenarios.data_model.SelectionStrategyEnum
:members:
13 changes: 13 additions & 0 deletions docs/api/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
=============
Documentation
=============

.. toctree::
:maxdepth: 2
:caption: References

der-scenario
selection-strategy
sizing-strategy
scenario-data-model
enumerations
33 changes: 33 additions & 0 deletions docs/api/scenario-data-model.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
====================
Scenario Data Models
====================

.. autopydantic_model:: emerge.scenarios.data_model.CustomerModel
:members:

.. autopydantic_model:: emerge.scenarios.data_model.EnergyBasedSolarSizingStrategyInput
:members:

.. autopydantic_model:: emerge.scenarios.data_model.SizeWithProbabilityModel
:members:

.. autopydantic_model:: emerge.scenarios.data_model.DERScenarioInput
:members:

.. autopydantic_model:: emerge.scenarios.data_model.BasicDERModel
:members:

.. autopydantic_model:: emerge.scenarios.data_model.DistDERScenarioModel
:members:

.. autopydantic_model:: emerge.scenarios.data_model.LoadMetadataModel
:members:

.. autopydantic_model:: emerge.scenarios.data_model.DERScenarioInputModel
:members:

.. autopydantic_model:: emerge.scenarios.data_model.ScenarioBaseConfig
:members:

.. autopydantic_model:: emerge.scenarios.data_model.DERScenarioConfigModel
:members:
15 changes: 15 additions & 0 deletions docs/api/selection-strategy.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
==================
Selection Strategy
==================


.. autoclass:: emerge.scenarios.selection_strategy.RandomSelectionStrategy
:members:

.. autoclass:: emerge.scenarios.selection_strategy.CloseSelectionStrategy
:members:

.. autoclass:: emerge.scenarios.selection_strategy.FarSelectionStrategy
:members:


13 changes: 13 additions & 0 deletions docs/api/sizing-strategy.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
==================
Sizing Strategy
==================


.. autoclass:: emerge.scenarios.sizing_strategy.EnergyBasedSolarSizingStrategy
:members:

.. autoclass:: emerge.scenarios.sizing_strategy.PeakMultiplierSizingStrategy
:members:

.. autoclass:: emerge.scenarios.sizing_strategy.FixedSizingStrategy
:members:
47 changes: 47 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# 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

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

project = "NREL-Emerge"
copyright = "2024, Kapil Duwadi, Erik Pohl"
author = "Kapil Duwadi, Erik Pohl"

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

extensions = [
"myst_parser",
"sphinx.ext.autodoc",
"sphinx.ext.autosummary",
"sphinx.ext.coverage",
"sphinx.ext.napoleon",
"sphinx.ext.intersphinx",
"sphinxcontrib.autodoc_pydantic",
"sphinxcontrib.mermaid",
]
templates_path = ["_templates"]
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]

autodoc_pydantic_model_show_json = False
autodoc_pydantic_model_show_config_summary = False
autodoc_pydantic_model_show_field_summary = False
autodoc_inherit_docstrings = False
autodoc_pydantic_field_show_constraints = False
autodoc_pydantic_settings_show_validator_summary = False
autodoc_pydantic_settings_show_validator_members = False
autodoc_pydantic_validator_list_fields = False
autodoc_pydantic_field_list_validators = False
autodoc_pydantic_model_show_validator_summary = False

html_theme = "pydata_sphinx_theme"


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

html_static_path = ["_static"]
source_suffix = [".md", ".rst"]
6 changes: 0 additions & 6 deletions docs/der-scenario.md

This file was deleted.

44 changes: 0 additions & 44 deletions docs/developers-guide.md

This file was deleted.

Loading

0 comments on commit b15b2e1

Please sign in to comment.