Skip to content
This repository was archived by the owner on Jan 12, 2024. It is now read-only.

Commit e485093

Browse files
authored
Merge pull request #17 from catalyst-cooperative/dev
Sphinx docs build, RTD, unit tests
2 parents 6a4789f + 9876fbd commit e485093

24 files changed

+510
-73
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Catalyst specific files
22
commit.txt
3+
*.swp
34

45
# Byte-compiled / optimized / DLL files
56
__pycache__/

.pre-commit-config.yaml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,13 @@ repos:
5353
- flake8-rst-docstrings
5454
- flake8-use-fstring
5555

56+
# Check for errors in restructuredtext (.rst) files under the doc hierarchy
57+
- repo: https://github.com/PyCQA/doc8
58+
rev: 0.11.1
59+
hooks:
60+
- id: doc8
61+
args: [--config, tox.ini]
62+
5663
- repo: https://github.com/myint/rstcheck
5764
rev: v5.0.0
5865
hooks:
@@ -70,6 +77,14 @@ repos:
7077
pass_filenames: false
7178
always_run: true
7279
entry: find notebooks \( -name \*.ipynb -not -name \*checkpoint.ipynb \) -type f -exec jupyter nbconvert --clear-output {} \;
80+
- id: unit-tests
81+
name: unit-tests
82+
stages: [commit]
83+
language: system
84+
verbose: false
85+
pass_filenames: false
86+
always_run: true
87+
entry: pytest --doctest-modules src/pudl_catalog tests/unit
7388

7489
# Configuration for pre-commit.ci
7590
ci:
@@ -81,5 +96,5 @@ ci:
8196
autoupdate_branch: main
8297
autoupdate_commit_msg: '[pre-commit.ci] pre-commit autoupdate'
8398
autoupdate_schedule: weekly
84-
skip: [nb-output-clear]
99+
skip: [nb-output-clear, unit-tests]
85100
submodules: false

.readthedocs.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# .readthedocs.yml
2+
# Read the Docs configuration file
3+
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
4+
5+
# Required
6+
version: 2
7+
8+
# Build documentation in the docs/ directory with Sphinx
9+
sphinx:
10+
configuration: docs/conf.py
11+
12+
build:
13+
image: testing
14+
apt_packages:
15+
- libsnappy-dev
16+
17+
# Set the version of Python and requirements required to build your docs
18+
python:
19+
version: "3.10"
20+
install:
21+
- method: pip
22+
path: .
23+
extra_requirements:
24+
- docs
File renamed without changes.

README.rst

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,27 @@ The PUDL Data Catalog
33

44
.. readme-intro
55
6-
.. image:: https://www.repostatus.org/badges/latest/concept.svg
7-
:target: https://www.repostatus.org/#concept
8-
:alt: Project Status: Concept - Minimal or no implementation has been done yet, or the repository is only intended to be a limited example, demo, or proof-of-concept.
9-
106
.. image:: https://github.com/catalyst-cooperative/pudl-catalog/workflows/tox-pytest/badge.svg
117
:target: https://github.com/catalyst-cooperative/pudl-catalog/actions?query=workflow%3Atox-pytest
128
:alt: Tox-PyTest Status
139

14-
.. image:: https://img.shields.io/codecov/c/github/catalyst-cooperative/pudl-catalog
10+
.. image:: https://img.shields.io/codecov/c/github/catalyst-cooperative/pudl-catalog?style=flat&logo=codecov
1511
:target: https://codecov.io/gh/catalyst-cooperative/pudl-catalog
1612
:alt: Codecov Test Coverage
1713

18-
.. image:: https://img.shields.io/pypi/v/catalystcoop.pudl_catalog
14+
.. image:: https://img.shields.io/readthedocs/catalystcoop-pudl-catalog?style=flat&logo=readthedocs
15+
:target: https://catalystcoop-pudl-catalog.readthedocs.io/en/latest/
16+
:alt: Read the Docs Build Status
17+
18+
.. image:: https://img.shields.io/pypi/v/catalystcoop.pudl_catalog?style=flat&logo=python
1919
:target: https://pypi.org/project/catalystcoop.pudl_catalog/
2020
:alt: PyPI Latest Version
2121

22-
.. image:: https://img.shields.io/conda/vn/conda-forge/catalystcoop.pudl_catalog
22+
.. image:: https://img.shields.io/conda/vn/conda-forge/catalystcoop.pudl_catalog?style=flat&logo=condaforge
2323
:target: https://anaconda.org/conda-forge/catalystcoop.pudl_catalog
2424
:alt: conda-forge Version
2525

26-
.. image:: https://img.shields.io/pypi/pyversions/catalystcoop.pudl_catalog
26+
.. image:: https://img.shields.io/pypi/pyversions/catalystcoop.pudl_catalog?style=flat&logo=python
2727
:target: https://pypi.org/project/catalystcoop.pudl_catalog
2828
:alt: Supported Python Versions
2929

@@ -121,7 +121,7 @@ this is weird).
121121
pudl_cat = intake.cat.pudl_cat
122122
list(pudl_cat)
123123
124-
.. code:: txt
124+
.. code:: text
125125
126126
['hourly_emissions_epacems', 'hourly_emissions_epacems_partitioned']
127127
@@ -135,7 +135,7 @@ but with all the Jinja template fields interpolated and filled in:
135135
136136
pudl_cat.hourly_emissions_epacems
137137
138-
.. code:: txt
138+
.. code:: text
139139
140140
hourly_emissions_epacems:
141141
args:
@@ -172,7 +172,7 @@ types:
172172
173173
pudl_cat.hourly_emissions_epacems.discover()
174174
175-
.. code:: txt
175+
.. code:: text
176176
177177
{'dtype': {'plant_id_eia': 'int32',
178178
'unitid': 'object',
@@ -243,15 +243,14 @@ on that dataframe to actually read the data and return a pandas dataframe:
243243
"co2_mass_tons",
244244
]].head()
245245
246-
==== ============== ======== ========================= ====== ======= ============= ============= ====================== =============== ==================== ===============
247-
.. plant_id_eia unitid operating_datetime_utc year state facility_id unit_id_epa operating_time_hours gross_load_mw heat_content_mmbtu co2_mass_tons
248-
==== ============== ======== ========================= ====== ======= ============= ============= ====================== =============== ==================== ===============
249-
0 469 4 2019-01-01 07:00:00+00:00 2019 CO 79 298 1 203 2146.2 127.2
250-
1 469 4 2019-01-01 08:00:00+00:00 2019 CO 79 298 1 203 2152.7 127.6
251-
2 469 4 2019-01-01 09:00:00+00:00 2019 CO 79 298 1 204 2142.2 127
252-
3 469 4 2019-01-01 10:00:00+00:00 2019 CO 79 298 1 204 2129.2 126.2
253-
4 469 4 2019-01-01 11:00:00+00:00 2019 CO 79 298 1 204 2160.6 128.1
254-
==== ============== ======== ========================= ====== ======= ============= ============= ====================== =============== ==================== ===============
246+
.. csv-table::
247+
:header: plant_id_eia, unitid, operating_datetime_utc, year, state, facility_id, unit_id_epa, operating_time_hours, gross_load_mw, heat_content_mmbtu, co2_mass_tons
248+
249+
469,4,2019-01-01 07:00:00+00:00,2019,CO,79,298,1.0,203.0,2146.2,127.2
250+
469,4,2019-01-01 08:00:00+00:00,2019,CO,79,298,1.0,203.0,2152.7,127.6
251+
469,4,2019-01-01 09:00:00+00:00,2019,CO,79,298,1.0,204.0,2142.2,127.0
252+
469,4,2019-01-01 10:00:00+00:00,2019,CO,79,298,1.0,204.0,2129.2,126.2
253+
469,4,2019-01-01 11:00:00+00:00,2019,CO,79,298,1.0,204.0,2160.6,128.1
255254

256255
Benefits of Intake Catalogs
257256
---------------------------

docs/CODE_OF_CONDUCT.md

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
2+
Catalyst Cooperative Code of Conduct
3+
====================================
4+
5+
Our Pledge
6+
----------
7+
8+
In the interest of fostering an open and welcoming environment, we as
9+
contributors and maintainers pledge to making participation in our project and
10+
our community a harassment-free experience for everyone, regardless of age,
11+
body size, disability, ethnicity, gender identity and expression, level of
12+
experience, nationality, personal appearance, race, religion, or sexual
13+
identity and orientation.
14+
15+
Our Standards
16+
-------------
17+
18+
Examples of behavior that contributes to creating a positive environment
19+
include:
20+
21+
* Using welcoming and inclusive language
22+
* Being respectful of differing viewpoints and experiences
23+
* Gracefully accepting constructive criticism
24+
* Focusing on what is best for the community
25+
* Showing empathy towards other community members
26+
27+
Examples of unacceptable behavior by participants include:
28+
29+
* The use of sexualized language or imagery and unwelcome sexual attention or
30+
advances
31+
* Trolling, insulting/derogatory comments, and personal or political attacks
32+
* Public or private harassment
33+
* Publishing others' private information, such as a physical or electronic
34+
address, without explicit permission
35+
* Other conduct which could reasonably be considered inappropriate in a
36+
professional setting
37+
38+
Our Responsibilities
39+
--------------------
40+
41+
Project maintainers are responsible for clarifying the standards of acceptable
42+
behavior and are expected to take appropriate and fair corrective action in
43+
response to any instances of unacceptable behavior.
44+
45+
Project maintainers have the right and responsibility to remove, edit, or
46+
reject comments, commits, code, wiki edits, issues, and other contributions
47+
that are not aligned to this Code of Conduct, or to ban temporarily or
48+
permanently any contributor for other behaviors that they deem inappropriate,
49+
threatening, offensive, or harmful.
50+
51+
Scope
52+
-----
53+
54+
This Code of Conduct applies both within project spaces and in public spaces
55+
when an individual is representing the project or its community. Examples of
56+
representing a project or community include using an official project e-mail
57+
address, posting via an official social media account, or acting as an
58+
appointed representative at an online or offline event. Representation of a
59+
project may be further defined and clarified by project maintainers.
60+
61+
Enforcement
62+
-----------
63+
64+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
65+
reported by contacting the project team at pudl@catalyst.coop. The project team
66+
will review and investigate all complaints, and will respond in a way that it
67+
deems appropriate to the circumstances. The project team is obligated to
68+
maintain confidentiality with regard to the reporter of an incident. Further
69+
details of specific enforcement policies may be posted separately.
70+
71+
Project maintainers who do not follow or enforce the Code of Conduct in good
72+
faith may face temporary or permanent repercussions as determined by other
73+
members of the project's leadership.
74+
75+
Attribution
76+
-----------
77+
78+
This Code of Conduct is adapted from the
79+
[Contributor Covenant version 1.4](http://contributor-covenant.org/version/1/4/)

docs/LICENSE.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
===============================================================================
2+
The MIT License
3+
===============================================================================
4+
5+
.. include:: ../LICENSE.txt
14.7 KB
Loading

docs/_static/custom.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.wy-table-responsive table td {
2+
white-space: normal;
3+
}

docs/_static/favicon.ico

4.19 KB
Binary file not shown.

0 commit comments

Comments
 (0)