nemas 0.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- nemas-0.0.0/.gitignore +172 -0
- nemas-0.0.0/LICENSE +21 -0
- nemas-0.0.0/PKG-INFO +23 -0
- nemas-0.0.0/README.md +7 -0
- nemas-0.0.0/docs/api/_static/custom.css +22 -0
- nemas-0.0.0/docs/api/_templates/copyright.html +1 -0
- nemas-0.0.0/docs/api/conf.py +111 -0
- nemas-0.0.0/docs/api/index.rst +18 -0
- nemas-0.0.0/docs/api/nemas.rst +12 -0
- nemas-0.0.0/docs/api/nemweb.rst +15 -0
- nemas-0.0.0/docs/build.sh +19 -0
- nemas-0.0.0/docs/guide/index.md +13 -0
- nemas-0.0.0/docs/guide/tutorial.md +14 -0
- nemas-0.0.0/docs/hooks.py +50 -0
- nemas-0.0.0/docs/mkdocs.yml +167 -0
- nemas-0.0.0/nemas/__init__.py +6 -0
- nemas-0.0.0/nemas/nemweb/__init__.py +5 -0
- nemas-0.0.0/nemas/nemweb/parser.py +10 -0
- nemas-0.0.0/pyproject.toml +43 -0
nemas-0.0.0/.gitignore
ADDED
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
#https://github.com/github/gitignore/blob/main/Python.gitignore
|
|
2
|
+
|
|
3
|
+
# Byte-compiled / optimized / DLL files
|
|
4
|
+
__pycache__/
|
|
5
|
+
*.py[cod]
|
|
6
|
+
*$py.class
|
|
7
|
+
|
|
8
|
+
# C extensions
|
|
9
|
+
*.so
|
|
10
|
+
|
|
11
|
+
# Distribution / packaging
|
|
12
|
+
.Python
|
|
13
|
+
build/
|
|
14
|
+
develop-eggs/
|
|
15
|
+
dist/
|
|
16
|
+
downloads/
|
|
17
|
+
eggs/
|
|
18
|
+
.eggs/
|
|
19
|
+
lib/
|
|
20
|
+
lib64/
|
|
21
|
+
parts/
|
|
22
|
+
sdist/
|
|
23
|
+
var/
|
|
24
|
+
wheels/
|
|
25
|
+
share/python-wheels/
|
|
26
|
+
*.egg-info/
|
|
27
|
+
.installed.cfg
|
|
28
|
+
*.egg
|
|
29
|
+
MANIFEST
|
|
30
|
+
|
|
31
|
+
# PyInstaller
|
|
32
|
+
# Usually these files are written by a python script from a template
|
|
33
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
34
|
+
*.manifest
|
|
35
|
+
*.spec
|
|
36
|
+
|
|
37
|
+
# Installer logs
|
|
38
|
+
pip-log.txt
|
|
39
|
+
pip-delete-this-directory.txt
|
|
40
|
+
|
|
41
|
+
# Unit test / coverage reports
|
|
42
|
+
htmlcov/
|
|
43
|
+
.tox/
|
|
44
|
+
.nox/
|
|
45
|
+
.coverage
|
|
46
|
+
.coverage.*
|
|
47
|
+
.cache
|
|
48
|
+
nosetests.xml
|
|
49
|
+
coverage.xml
|
|
50
|
+
*.cover
|
|
51
|
+
*.py,cover
|
|
52
|
+
.hypothesis/
|
|
53
|
+
.pytest_cache/
|
|
54
|
+
cover/
|
|
55
|
+
|
|
56
|
+
# Translations
|
|
57
|
+
*.mo
|
|
58
|
+
*.pot
|
|
59
|
+
|
|
60
|
+
# Django stuff:
|
|
61
|
+
*.log
|
|
62
|
+
local_settings.py
|
|
63
|
+
db.sqlite3
|
|
64
|
+
db.sqlite3-journal
|
|
65
|
+
|
|
66
|
+
# Flask stuff:
|
|
67
|
+
instance/
|
|
68
|
+
.webassets-cache
|
|
69
|
+
|
|
70
|
+
# Scrapy stuff:
|
|
71
|
+
.scrapy
|
|
72
|
+
|
|
73
|
+
# Sphinx documentation
|
|
74
|
+
docs/_build/
|
|
75
|
+
|
|
76
|
+
# PyBuilder
|
|
77
|
+
.pybuilder/
|
|
78
|
+
target/
|
|
79
|
+
|
|
80
|
+
# Jupyter Notebook
|
|
81
|
+
.ipynb_checkpoints
|
|
82
|
+
|
|
83
|
+
# IPython
|
|
84
|
+
profile_default/
|
|
85
|
+
ipython_config.py
|
|
86
|
+
|
|
87
|
+
# pyenv
|
|
88
|
+
# For a library or package, you might want to ignore these files since the code is
|
|
89
|
+
# intended to run in multiple environments; otherwise, check them in:
|
|
90
|
+
# .python-version
|
|
91
|
+
|
|
92
|
+
# pipenv
|
|
93
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
94
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
95
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
96
|
+
# install all needed dependencies.
|
|
97
|
+
#Pipfile.lock
|
|
98
|
+
|
|
99
|
+
# poetry
|
|
100
|
+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
|
101
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
102
|
+
# commonly ignored for libraries.
|
|
103
|
+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
|
104
|
+
#poetry.lock
|
|
105
|
+
|
|
106
|
+
# pdm
|
|
107
|
+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
|
108
|
+
#pdm.lock
|
|
109
|
+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
|
|
110
|
+
# in version control.
|
|
111
|
+
# https://pdm.fming.dev/#use-with-ide
|
|
112
|
+
.pdm.toml
|
|
113
|
+
|
|
114
|
+
# PEP 582; used by e.g. github.com/user/pyflow and github.com/pdm-project/pdm
|
|
115
|
+
__pypackages__/
|
|
116
|
+
|
|
117
|
+
# Celery stuff
|
|
118
|
+
celerybeat-schedule
|
|
119
|
+
celerybeat.pid
|
|
120
|
+
|
|
121
|
+
# SageMath parsed files
|
|
122
|
+
*.sage.py
|
|
123
|
+
|
|
124
|
+
# Environments
|
|
125
|
+
.env
|
|
126
|
+
.venv
|
|
127
|
+
env/
|
|
128
|
+
venv/
|
|
129
|
+
ENV/
|
|
130
|
+
env.bak/
|
|
131
|
+
venv.bak/
|
|
132
|
+
|
|
133
|
+
# Spyder project settings
|
|
134
|
+
.spyderproject
|
|
135
|
+
.spyproject
|
|
136
|
+
|
|
137
|
+
# Rope project settings
|
|
138
|
+
.ropeproject
|
|
139
|
+
|
|
140
|
+
# build
|
|
141
|
+
/_build
|
|
142
|
+
|
|
143
|
+
# mkdocs documentation
|
|
144
|
+
/site
|
|
145
|
+
|
|
146
|
+
# sphinx documentation
|
|
147
|
+
/docs/api/api
|
|
148
|
+
|
|
149
|
+
# mypy
|
|
150
|
+
.mypy_cache/
|
|
151
|
+
.dmypy.json
|
|
152
|
+
dmypy.json
|
|
153
|
+
|
|
154
|
+
# Pyre type checker
|
|
155
|
+
.pyre/
|
|
156
|
+
|
|
157
|
+
# pytype static type analyzer
|
|
158
|
+
.pytype/
|
|
159
|
+
|
|
160
|
+
# Cython debug symbols
|
|
161
|
+
cython_debug/
|
|
162
|
+
|
|
163
|
+
# PyCharm
|
|
164
|
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
|
165
|
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
|
166
|
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
|
167
|
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
|
168
|
+
#.idea/
|
|
169
|
+
Footer
|
|
170
|
+
|
|
171
|
+
# Visual Studio Code settings
|
|
172
|
+
.vscode/
|
nemas-0.0.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Sean Ma
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
nemas-0.0.0/PKG-INFO
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: nemas
|
|
3
|
+
Version: 0.0.0
|
|
4
|
+
Summary: National Electricity Market Analytics System (NEMAS)
|
|
5
|
+
Author-email: Sean Ma <sean.sl.ma@gmail.com>
|
|
6
|
+
License: MIT
|
|
7
|
+
License-File: LICENSE
|
|
8
|
+
Classifier: Development Status :: 2 - Pre-Alpha
|
|
9
|
+
Classifier: Intended Audience :: Science/Research
|
|
10
|
+
Classifier: Programming Language :: Python :: 3
|
|
11
|
+
Requires-Python: >=3.12
|
|
12
|
+
Requires-Dist: numpy
|
|
13
|
+
Requires-Dist: pandas
|
|
14
|
+
Requires-Dist: polars
|
|
15
|
+
Description-Content-Type: text/markdown
|
|
16
|
+
|
|
17
|
+
# nemas
|
|
18
|
+
|
|
19
|
+
National Electricity Market Analytics System (NEMAS).
|
|
20
|
+
|
|
21
|
+
An open-source Python API engineered for analyzing NEM market data, pricing structures, curtailment events, and financial revenue profiles.
|
|
22
|
+
|
|
23
|
+
*Note: This package is currently in active pre-alpha development.*
|
nemas-0.0.0/README.md
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# nemas
|
|
2
|
+
|
|
3
|
+
National Electricity Market Analytics System (NEMAS).
|
|
4
|
+
|
|
5
|
+
An open-source Python API engineered for analyzing NEM market data, pricing structures, curtailment events, and financial revenue profiles.
|
|
6
|
+
|
|
7
|
+
*Note: This package is currently in active pre-alpha development.*
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/* Force line break before ALL parameters including the first */
|
|
2
|
+
dt.sig.sig-object em.sig-param::before {
|
|
3
|
+
content: "\A ";
|
|
4
|
+
white-space: pre;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
/* Ensure commas stay inline */
|
|
8
|
+
dt.sig.sig-object .w {
|
|
9
|
+
display: inline;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/* Add comma after last parameter and force line break after it */
|
|
13
|
+
dt.sig.sig-object em.sig-param:last-of-type::after {
|
|
14
|
+
content: ",\A";
|
|
15
|
+
white-space: pre;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/* Alternative: target the closing parenthesis directly */
|
|
19
|
+
dt.sig.sig-object span.sig-paren:last-of-type::before {
|
|
20
|
+
content: "\A";
|
|
21
|
+
white-space: pre;
|
|
22
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{{ copyright_html }}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
# -- Path setup --------------------------------------------------------------
|
|
2
|
+
import os
|
|
3
|
+
import sys
|
|
4
|
+
from datetime import datetime
|
|
5
|
+
|
|
6
|
+
# Add the project root to the path so Sphinx can find the 'nemas' package
|
|
7
|
+
sys.path.insert(0, os.path.abspath('../../'))
|
|
8
|
+
|
|
9
|
+
# -- Project information -----------------------------------------------------
|
|
10
|
+
project = 'nemas'
|
|
11
|
+
copyright = '2026, Sean Ma'
|
|
12
|
+
author = 'Sean Ma'
|
|
13
|
+
release = '0.0.1'
|
|
14
|
+
|
|
15
|
+
# -- General configuration ---------------------------------------------------
|
|
16
|
+
extensions = [
|
|
17
|
+
# Core Sphinx extensions
|
|
18
|
+
'sphinx.ext.autodoc', # To include documentation from docstrings
|
|
19
|
+
'sphinx.ext.viewcode', # To link to the source code
|
|
20
|
+
'sphinx.ext.autosummary', # To automatically generate summary tables
|
|
21
|
+
# Additional utility extensions
|
|
22
|
+
# 'sphinx_autodoc_typehints', # To display type hints nicely
|
|
23
|
+
'numpydoc', # To support NumPy style docstrings
|
|
24
|
+
'sphinx_design', # For badges, cards, etc.
|
|
25
|
+
'sphinx.ext.autodoc',
|
|
26
|
+
'sphinx.ext.napoleon',
|
|
27
|
+
'sphinx_copybutton', # To add copy buttons to code blocks
|
|
28
|
+
]
|
|
29
|
+
|
|
30
|
+
# Strip the >>> and ... prompts so copied code is clean
|
|
31
|
+
copybutton_prompt_text = '>>> |\\.\\.\\. '
|
|
32
|
+
copybutton_prompt_is_regexp = True
|
|
33
|
+
|
|
34
|
+
# The suffix(es) of source filenames.
|
|
35
|
+
source_suffix = '.rst'
|
|
36
|
+
|
|
37
|
+
# The master toctree document.
|
|
38
|
+
master_doc = 'index'
|
|
39
|
+
|
|
40
|
+
# Add any paths that contain templates here, relative to this directory.
|
|
41
|
+
templates_path = ['_templates']
|
|
42
|
+
|
|
43
|
+
# List of patterns, relative to source directory, that match files and
|
|
44
|
+
# directories to ignore when looking for source files.
|
|
45
|
+
# This pattern also affects html_static_path and html_extra_path.
|
|
46
|
+
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
|
|
47
|
+
|
|
48
|
+
# -- Options for HTML output -------------------------------------------------
|
|
49
|
+
# The theme to use. This enables the PyData Sphinx Theme.
|
|
50
|
+
html_theme = 'pydata_sphinx_theme'
|
|
51
|
+
|
|
52
|
+
# The theme options
|
|
53
|
+
html_theme_options = {
|
|
54
|
+
'github_url': 'https://github.com/seanslma/nemas',
|
|
55
|
+
'secondary_sidebar_items': [], # Disable the secondary sidebar items (page toc)
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
# Add any paths that contain custom static files (such as style sheets) here,
|
|
59
|
+
# relative to this directory. They are copied after the builtin static files,
|
|
60
|
+
# so a file named "default.css" will overwrite the builtin "default.css".
|
|
61
|
+
html_static_path = ['_static']
|
|
62
|
+
|
|
63
|
+
# Custom CSS files
|
|
64
|
+
html_css_files = [
|
|
65
|
+
'custom.css',
|
|
66
|
+
]
|
|
67
|
+
|
|
68
|
+
# If true, the rest sources are included in the HTML build as _sources/foo.txt.
|
|
69
|
+
html_copy_source = False
|
|
70
|
+
|
|
71
|
+
# disable default copyright
|
|
72
|
+
html_show_copyright = False
|
|
73
|
+
|
|
74
|
+
# Add back to home link and copyright in the footer
|
|
75
|
+
html_context = {
|
|
76
|
+
'copyright_html': f'<a href="/" title="Go to Main Home Page">🏠 Back to Home</a><br>Copyright © {datetime.now().year} Sean Ma'
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
# If true, "Created using Sphinx" is shown in the HTML footer.
|
|
80
|
+
html_show_sphinx = True
|
|
81
|
+
|
|
82
|
+
# -- Autodoc configuration ---------------------------------------------------
|
|
83
|
+
# Type hints: show in signature only (not in description)
|
|
84
|
+
# autodoc_typehints = "signature"
|
|
85
|
+
|
|
86
|
+
# Use short format for type hints
|
|
87
|
+
# autodoc_typehints_format = "short"
|
|
88
|
+
|
|
89
|
+
# Preserve the defaults in signatures
|
|
90
|
+
autodoc_preserve_defaults = True
|
|
91
|
+
|
|
92
|
+
# -- Sphinx autodoc typehints configuration ----------------------------------
|
|
93
|
+
# This prevents duplicate parameter documentation in the body
|
|
94
|
+
# typehints_defaults = "comma"
|
|
95
|
+
|
|
96
|
+
# -- Numpydoc configuration ---------------------------------------------------
|
|
97
|
+
# Don't show class members automatically
|
|
98
|
+
numpydoc_show_class_members = False
|
|
99
|
+
|
|
100
|
+
# Don't show type hints in the parameter descriptions since they're in signature
|
|
101
|
+
numpydoc_show_type_hint = False
|
|
102
|
+
|
|
103
|
+
# Mock imports for modules that are not available in the documentation environment
|
|
104
|
+
autodoc_mock_imports = []
|
|
105
|
+
|
|
106
|
+
# Global setup for doctests
|
|
107
|
+
doctest_global_setup = """
|
|
108
|
+
import numpy as np
|
|
109
|
+
import polars as pl
|
|
110
|
+
# anything else needed globally
|
|
111
|
+
"""
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
.. nemas documentation master file
|
|
2
|
+
|
|
3
|
+
nemas API Reference
|
|
4
|
+
==================
|
|
5
|
+
|
|
6
|
+
.. toctree::
|
|
7
|
+
:maxdepth: 2
|
|
8
|
+
:caption: Contents:
|
|
9
|
+
|
|
10
|
+
nemas
|
|
11
|
+
nemweb
|
|
12
|
+
|
|
13
|
+
Indices and tables
|
|
14
|
+
==================
|
|
15
|
+
|
|
16
|
+
* :ref:`genindex`
|
|
17
|
+
* :ref:`modindex`
|
|
18
|
+
* :ref:`search`
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
# Step 1: Clean any old builds
|
|
4
|
+
rm -rf _build/html/
|
|
5
|
+
|
|
6
|
+
# Step 2: Change to the docs directory
|
|
7
|
+
cd docs
|
|
8
|
+
|
|
9
|
+
# Step 3: Build the MkDocs guide first (creates the '_build/html' folder)
|
|
10
|
+
mkdocs build --site-dir ../_build/html
|
|
11
|
+
|
|
12
|
+
# Step 4: Build Sphinx directly into the compiled MkDocs '_build/api' folder
|
|
13
|
+
sphinx-build -b html api ../_build/html/api
|
|
14
|
+
|
|
15
|
+
# Step 5: Return to the root directory
|
|
16
|
+
cd ..
|
|
17
|
+
|
|
18
|
+
# Copy to the final build directory
|
|
19
|
+
cp -a ./_build/html/. ../seanslma.github.io/nemas/
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Welcome to nemas
|
|
2
|
+
|
|
3
|
+
National Electricity Market Analytics System (NEMAS).
|
|
4
|
+
|
|
5
|
+
This user guide is intended to walk you through getting started, providing examples, and explaining core concepts.
|
|
6
|
+
|
|
7
|
+
## Structure
|
|
8
|
+
|
|
9
|
+
User Guide: Conceptual overviews, installation steps, and tutorials.
|
|
10
|
+
|
|
11
|
+
API Reference: Detailed, auto-generated documentation for every function and class (powered by Sphinx).
|
|
12
|
+
|
|
13
|
+
Check out the Tutorial to see how nemas works!
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Tutorial: Using NEMAS
|
|
2
|
+
|
|
3
|
+
This tutorial shows you how to use the `nemas` python package.
|
|
4
|
+
|
|
5
|
+
## 1. Install the package
|
|
6
|
+
|
|
7
|
+
First, ensure you have the `nemas` package installed:
|
|
8
|
+
```sh
|
|
9
|
+
pip install nemas
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## 2. Extracting data from nemweb
|
|
13
|
+
|
|
14
|
+
Will be provided later.
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import re
|
|
2
|
+
import datetime
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
def on_page_markdown(markdown, **kwargs):
|
|
6
|
+
"""
|
|
7
|
+
Add blank line before lists that don't have one.
|
|
8
|
+
Matches: text\n- item (no blank line)
|
|
9
|
+
Replaces with: text\n\n- item (adds blank line)
|
|
10
|
+
"""
|
|
11
|
+
# Pattern: non-empty line followed by newline and list item
|
|
12
|
+
# Negative lookbehind ensures previous line isn't already blank
|
|
13
|
+
pattern = r'(?<!\n)\n([-*+]\s)'
|
|
14
|
+
replacement = r'\n\n\1'
|
|
15
|
+
|
|
16
|
+
return re.sub(pattern, replacement, markdown)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def on_config(config):
|
|
20
|
+
# Replace {year} once globally
|
|
21
|
+
now = datetime.datetime.now()
|
|
22
|
+
# date = now.strftime('%-d %b %Y')
|
|
23
|
+
copyright = config.get('copyright', '')
|
|
24
|
+
config['raw_copyright'] = copyright.replace('{year}', str(now.year))
|
|
25
|
+
|
|
26
|
+
return config
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def on_page_context(context, page, config, nav):
|
|
30
|
+
# Determine which date to use
|
|
31
|
+
if page.is_homepage:
|
|
32
|
+
display_date = datetime.datetime.now().strftime('%-d %b %Y')
|
|
33
|
+
else:
|
|
34
|
+
# Try to get the Git date from plugin metadata
|
|
35
|
+
display_date = (
|
|
36
|
+
page.meta.get('git_revision_date_localized')
|
|
37
|
+
or page.meta.get('revision_date')
|
|
38
|
+
or datetime.datetime.now().strftime('%-d %b %Y')
|
|
39
|
+
)
|
|
40
|
+
updated_at = f'Last updated on {display_date}'
|
|
41
|
+
|
|
42
|
+
# Remove it from metadata to avoid auto creating `last updated` field
|
|
43
|
+
page.meta.pop('git_revision_date_localized', None)
|
|
44
|
+
|
|
45
|
+
# Build a per-page footer WITHOUT mutating the global config
|
|
46
|
+
# Use context['copyright'] instead of config['copyright']
|
|
47
|
+
copyright = config['raw_copyright']
|
|
48
|
+
context['config']['copyright'] = f'{copyright}<br>{updated_at}'
|
|
49
|
+
|
|
50
|
+
return context
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
# Required: The site_name is the title of your documentation site.
|
|
2
|
+
# It will appear in the browser tab and at the top of the navigation.
|
|
3
|
+
site_name: nemas
|
|
4
|
+
|
|
5
|
+
# Optional: The repository URL for your project
|
|
6
|
+
repo_url: https://github.com/seanslma/nemas
|
|
7
|
+
|
|
8
|
+
# Optional: The URL where your site will be hosted.
|
|
9
|
+
# This is used for generating absolute URLs in the site.
|
|
10
|
+
site_url: https://seanslma.github.io/nemas
|
|
11
|
+
|
|
12
|
+
# Optional: A short description of your site.
|
|
13
|
+
# Used in metadata for SEO and sometimes in the theme.
|
|
14
|
+
site_description: My python utils package
|
|
15
|
+
|
|
16
|
+
# Optional: The base URL of your site if deployed to a sub-path.
|
|
17
|
+
# For example, if your docs are at 'example.com/docs/', set this to '/docs/'.
|
|
18
|
+
# base_url: /docs/
|
|
19
|
+
|
|
20
|
+
# Optional: The author(s) of the documentation.
|
|
21
|
+
site_author: Sean Ma
|
|
22
|
+
|
|
23
|
+
# Where to save the web content
|
|
24
|
+
site_dir: ../../doc/nemas
|
|
25
|
+
|
|
26
|
+
# Navigation Structure
|
|
27
|
+
# The 'nav' section defines the structure and order of your documentation.
|
|
28
|
+
# Each entry is a title, followed by the path to the Markdown file or a nested list.
|
|
29
|
+
nav:
|
|
30
|
+
- Home: 'index.md'
|
|
31
|
+
- Tutorial: 'tutorial.md'
|
|
32
|
+
- API Reference: ./api/index.html # Link to the separate Sphinx docs
|
|
33
|
+
|
|
34
|
+
# Configuration
|
|
35
|
+
docs_dir: guide/
|
|
36
|
+
|
|
37
|
+
# Copyright notice
|
|
38
|
+
copyright: |
|
|
39
|
+
<a href="/" title="Go to Main Home Page">🏠 Back to Home</a><br>
|
|
40
|
+
Copyright © {year} Sean Ma
|
|
41
|
+
|
|
42
|
+
# Theme Configuration
|
|
43
|
+
# The 'theme' section defines the look and feel of your documentation.
|
|
44
|
+
theme:
|
|
45
|
+
# The name of the theme to use. 'material' is highly recommended for its features.
|
|
46
|
+
name: material
|
|
47
|
+
# custom_dir: theme
|
|
48
|
+
|
|
49
|
+
# Optional: Specify a custom language for your documentation.
|
|
50
|
+
# This affects localization of theme elements (e.g., "Next", "Previous").
|
|
51
|
+
language: en
|
|
52
|
+
|
|
53
|
+
# Optional: Define colors for various parts of the theme.
|
|
54
|
+
palette:
|
|
55
|
+
# Scheme can be 'default' (light) or 'slate' (dark).
|
|
56
|
+
- scheme: default # Light mode `preference`
|
|
57
|
+
primary: amber
|
|
58
|
+
accent: yellow
|
|
59
|
+
toggle:
|
|
60
|
+
icon: material/brightness-4 # Icon for dark mode toggle
|
|
61
|
+
name: Switch to dark mode
|
|
62
|
+
- scheme: slate # Dark mode
|
|
63
|
+
toggle:
|
|
64
|
+
icon: material/brightness-7 # Icon for light mode toggle
|
|
65
|
+
name: Switch to light mode
|
|
66
|
+
|
|
67
|
+
# Optional: Choose a primary and accent color from Material Design palette.
|
|
68
|
+
# https://squidfunk.github.io/mkdocs-material/setup/setting-up-colors/#palette
|
|
69
|
+
# primary: indigo
|
|
70
|
+
# accent: indigo
|
|
71
|
+
|
|
72
|
+
# Optional: Set the font families for text and code.
|
|
73
|
+
font:
|
|
74
|
+
text: Roboto
|
|
75
|
+
code: Roboto Mono
|
|
76
|
+
|
|
77
|
+
# Optional: Add an icon to the site title.
|
|
78
|
+
# The icon must be available in the Material Design Icons font.
|
|
79
|
+
# https://squidfunk.github.io/mkdocs-material/reference/icons-emojis/#search
|
|
80
|
+
icon:
|
|
81
|
+
logo: material/library
|
|
82
|
+
repo: fontawesome/brands/git-alt
|
|
83
|
+
|
|
84
|
+
# Optional: Enable specific features of the Material theme.
|
|
85
|
+
# https://squidfunk.github.io/mkdocs-material/setup/setting-up-features/
|
|
86
|
+
features:
|
|
87
|
+
- header.autohide
|
|
88
|
+
- navigation.indexes
|
|
89
|
+
- navigation.tabs # Top-level tabs for main sections
|
|
90
|
+
- navigation.tabs.sticky
|
|
91
|
+
- navigation.instant # Instant page loading for faster navigation
|
|
92
|
+
- navigation.tracking # Highlights active section in side nav
|
|
93
|
+
- navigation.sections # Groups sub-sections under top-level entries
|
|
94
|
+
- navigation.top # Back to top button
|
|
95
|
+
- content.code.copy # Adds a "copy" button to code blocks
|
|
96
|
+
- search.highlight # Highlight search results on page
|
|
97
|
+
- search.suggest # Auto-suggest for search queries
|
|
98
|
+
# - toc.integrate # Integrate Table of Contents into main navigation
|
|
99
|
+
|
|
100
|
+
# Optional: Additional CSS or JavaScript files.
|
|
101
|
+
# extra_css:
|
|
102
|
+
# - stylesheets/extra.css
|
|
103
|
+
# extra_javascript:
|
|
104
|
+
# - javascripts/extra.js
|
|
105
|
+
|
|
106
|
+
plugins:
|
|
107
|
+
- search
|
|
108
|
+
- mkdocstrings:
|
|
109
|
+
default_handler: python
|
|
110
|
+
handlers:
|
|
111
|
+
python:
|
|
112
|
+
paths:
|
|
113
|
+
# THIS IS THE CRUCIAL PART!
|
|
114
|
+
# The path to the directory that *contains* your 'sim' package.
|
|
115
|
+
# If mkdocs.yaml is in 'my_project_root/docs/'
|
|
116
|
+
# and 'sim' is in 'my_project_root/mapy/sim',
|
|
117
|
+
# you need to go UP one level (..) to 'my_project_root/',
|
|
118
|
+
# then DOWN into 'mapy/'.
|
|
119
|
+
- ../nemas/ # <--- Corrected path!
|
|
120
|
+
options:
|
|
121
|
+
show_source: true
|
|
122
|
+
show_root_heading: true
|
|
123
|
+
show_root_toc_entry: true
|
|
124
|
+
show_root_full_path: true
|
|
125
|
+
show_object_full_path: false
|
|
126
|
+
show_category_heading: true
|
|
127
|
+
show_signature_annotations: true
|
|
128
|
+
signature_crossrefs: true
|
|
129
|
+
docstring_style: numpy # google
|
|
130
|
+
members_order: source
|
|
131
|
+
separate_signature: false
|
|
132
|
+
docstring_section_style: table
|
|
133
|
+
# filters: ["!^_"] # Example: exclude private members
|
|
134
|
+
|
|
135
|
+
# extra:
|
|
136
|
+
# social:
|
|
137
|
+
# - icon: example-icon
|
|
138
|
+
# link: https://my.example.com/example
|
|
139
|
+
|
|
140
|
+
# Extensions for Markdown
|
|
141
|
+
# mkdocs uses Python Markdown. This section enables additional Markdown syntax.
|
|
142
|
+
# https://squidfunk.github.io/mkdocs-material/reference/markdown-extensions/
|
|
143
|
+
markdown_extensions:
|
|
144
|
+
- toc:
|
|
145
|
+
permalink: true
|
|
146
|
+
toc_depth: 3
|
|
147
|
+
- mdx_math # python-markdown-math
|
|
148
|
+
- attr_list # Allows adding HTML attributes to Markdown elements
|
|
149
|
+
- md_in_html # Allows Markdown inside HTML blocks
|
|
150
|
+
- admonition # For "note", "tip", "warning" boxes (MkDocs-Material style)
|
|
151
|
+
# - pymdownx.highlight: # Code syntax highlighting
|
|
152
|
+
# anchor_linenums: true # Anchor line numbers in code blocks
|
|
153
|
+
# line_numbers: true # Show line numbers
|
|
154
|
+
# linenums_style: pymdownx-inline # Style for line numbers
|
|
155
|
+
- pymdownx.superfences # Nested code blocks, enables fenced diagrams
|
|
156
|
+
- pymdownx.details # Expandable details/summary blocks
|
|
157
|
+
- pymdownx.critic # Markdown extension for critic marks (additions, deletions)
|
|
158
|
+
- pymdownx.tasklist: # Task lists (checkboxes)
|
|
159
|
+
custom_checkbox: true
|
|
160
|
+
# - pymdownx.tabbed: # Tabbed content blocks
|
|
161
|
+
# alternate
|
|
162
|
+
|
|
163
|
+
extra_javascript:
|
|
164
|
+
- https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=TeX-AMS-MML_HTMLorMML
|
|
165
|
+
|
|
166
|
+
hooks:
|
|
167
|
+
- hooks.py
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling", "hatch-vcs"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "nemas"
|
|
7
|
+
dynamic = ["version"]
|
|
8
|
+
description = "National Electricity Market Analytics System (NEMAS)"
|
|
9
|
+
authors = [
|
|
10
|
+
{name = "Sean Ma", email = "sean.sl.ma@gmail.com"},
|
|
11
|
+
]
|
|
12
|
+
readme = "README.md"
|
|
13
|
+
requires-python = ">=3.12"
|
|
14
|
+
license = {text = "MIT"}
|
|
15
|
+
|
|
16
|
+
classifiers = [
|
|
17
|
+
"Development Status :: 2 - Pre-Alpha",
|
|
18
|
+
"Intended Audience :: Science/Research",
|
|
19
|
+
"Programming Language :: Python :: 3",
|
|
20
|
+
]
|
|
21
|
+
|
|
22
|
+
dependencies = [
|
|
23
|
+
"numpy",
|
|
24
|
+
"pandas",
|
|
25
|
+
"polars",
|
|
26
|
+
]
|
|
27
|
+
|
|
28
|
+
[tool.hatch.version]
|
|
29
|
+
source = "vcs"
|
|
30
|
+
|
|
31
|
+
[tool.hatch.build]
|
|
32
|
+
exclude = [
|
|
33
|
+
"conda_*",
|
|
34
|
+
"**/conda_*",
|
|
35
|
+
]
|
|
36
|
+
|
|
37
|
+
[tool.ruff]
|
|
38
|
+
line-length = 88
|
|
39
|
+
target-version = "py312"
|
|
40
|
+
|
|
41
|
+
[tool.ruff.format]
|
|
42
|
+
preview = false
|
|
43
|
+
quote-style = "single"
|