Skip to content

Commit

Permalink
Merge pull request #72 from philip-ndikum/update-readme
Browse files Browse the repository at this point in the history
Update readme
  • Loading branch information
philip-ndikum authored Jan 6, 2025
2 parents 3b41e8f + 793c5a9 commit ad53041
Show file tree
Hide file tree
Showing 3 changed files with 123 additions and 17 deletions.
83 changes: 73 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,79 @@

---
<div align="center">

| | |
|:---|:---|
| **Compatibility** | [![Python Version](https://img.shields.io/badge/python-3.10%2B-blue)](https://img.shields.io/badge/python-3.10%2B-blue) [![Linux Compatible](https://img.shields.io/badge/OS-Linux-blue)](https://img.shields.io/badge/OS-Linux-blue) |
| **Docs** | [![Documentation Status](https://readthedocs.org/projects/temporalscope/badge/?version=latest)](https://temporalscope.readthedocs.io/en/latest/?badge=latest) |
| **Meta** | [![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://docs.astral.sh/ruff/) [![Checked with mypy](https://www.mypy-lang.org/static/mypy_badge.svg)](https://www.mypy-lang.org/static/mypy_badge.svg) [![License](https://img.shields.io/badge/License-Apache%202.0-green)](https://img.shields.io/badge/License-Apache%202.0-green) |
| **Build Tools** | [![Hatch project](https://img.shields.io/badge/%F0%9F%A5%9A-Hatch-4051b5.svg)](https://hatch.pypa.io/latest/) |
| **CI/CD** | [![pre-commit.ci status](https://results.pre-commit.ci/badge/github/philip-ndikum/TemporalScope/main.svg)](https://results.pre-commit.ci/latest/github/philip-ndikum/TemporalScope/main) [![GitHub Actions](https://github.com/philip-ndikum/TemporalScope/actions/workflows/test.yml/badge.svg)](https://github.com/philip-ndikum/TemporalScope/actions/workflows/test.yml) [![Coverage Status](https://coveralls.io/repos/github/philip-ndikum/TemporalScope/badge.svg)](https://coveralls.io/github/philip-ndikum/TemporalScope) [![License and Dependency Check](https://github.com/philip-ndikum/TemporalScope/actions/workflows/license-compliance.yml/badge.svg)](https://github.com/philip-ndikum/TemporalScope/actions/workflows/license-compliance.yml) |
| **Security** | [![OpenSSF Best Practices](https://www.bestpractices.dev/projects/9424/badge)](https://www.bestpractices.dev/projects/9424) [![Security: Bandit](https://img.shields.io/badge/security-bandit-yellow.svg)](https://github.com/PyCQA/bandit) |

<table>
<tbody>
<tr>
<td><strong>Compatibility</strong></td>
<td>
<a href="https://img.shields.io/badge/python-3.10%2B-blue">
<img src="https://img.shields.io/badge/python-3.10%2B-blue" alt="Python Version">
</a>
<a href="https://img.shields.io/badge/OS-Linux-blue">
<img src="https://img.shields.io/badge/OS-Linux-blue" alt="Linux Compatible">
</a>
</td>
</tr>
<tr>
<td><strong>Docs</strong></td>
<td>
<a href="https://temporalscope.readthedocs.io/en/latest/?badge=latest">
<img src="https://readthedocs.org/projects/temporalscope/badge/?version=latest" alt="Documentation Status">
</a>
</td>
</tr>
<tr>
<td><strong>Meta</strong></td>
<td>
<a href="https://docs.astral.sh/ruff/">
<img src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json" alt="Ruff">
</a>
<a href="https://www.mypy-lang.org/static/mypy_badge.svg">
<img src="https://www.mypy-lang.org/static/mypy_badge.svg" alt="Checked with mypy">
</a>
<a href="https://img.shields.io/badge/License-Apache%202.0-green">
<img src="https://img.shields.io/badge/License-Apache%202.0-green" alt="License">
</a>
</td>
</tr>
<tr>
<td><strong>Build Tools</strong></td>
<td>
<a href="https://hatch.pypa.io/latest/">
<img src="https://img.shields.io/badge/%F0%9F%A5%9A-Hatch-4051b5.svg" alt="Hatch project">
</a>
</td>
</tr>
<tr>
<td><strong>CI/CD</strong></td>
<td>
<a href="https://results.pre-commit.ci/latest/github/philip-ndikum/TemporalScope/main">
<img src="https://results.pre-commit.ci/badge/github/philip-ndikum/TemporalScope/main.svg" alt="pre-commit.ci status">
</a>
<a href="https://github.com/philip-ndikum/TemporalScope/actions/workflows/test.yml">
<img src="https://github.com/philip-ndikum/TemporalScope/actions/workflows/test.yml/badge.svg" alt="GitHub Actions">
</a>
<a href="https://coveralls.io/github/philip-ndikum/TemporalScope">
<img src="https://coveralls.io/repos/github/philip-ndikum/TemporalScope/badge.svg" alt="Coverage Status">
</a>
<a href="https://github.com/philip-ndikum/TemporalScope/actions/workflows/license-compliance.yml">
<img src="https://github.com/philip-ndikum/TemporalScope/actions/workflows/license-compliance.yml/badge.svg" alt="License and Dependency Check">
</a>
</td>
</tr>
<tr>
<td><strong>Security</strong></td>
<td>
<a href="https://www.bestpractices.dev/projects/9424">
<img src="https://www.bestpractices.dev/projects/9424/badge" alt="OpenSSF Best Practices">
</a>
<a href="https://github.com/PyCQA/bandit">
<img src="https://img.shields.io/badge/security-bandit-yellow.svg" alt="Security: Bandit">
</a>
</td>
</tr>
</tbody>
</table>
</div>

**TemporalScope** is an open-source Python package designed to bridge the gap between scientific research and practical industry applications for analyzing the temporal dynamics of feature importance in AI & ML time series models. Developed in alignment with Linux Foundation standards and licensed under Apache 2.0, it builds on tools such as Boruta-SHAP and SHAP, using modern window partitioning algorithms to tackle challenges like non-stationarity and concept drift.
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ docs = [
"mkdocs-literate-nav",
"mkdocs-section-index",
"markdown-callouts",
"nbformat",
"black",
"polars",
"dask",
Expand Down
56 changes: 49 additions & 7 deletions scripts/gen_tutorial_pages.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,17 @@
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
# OF ANY KIND, either express or implied. See the License for
# the specific language governing permissions and limitations
# under the License.

"""Generate tutorial pages from Jupyter notebooks."""

from pathlib import Path

import mkdocs_gen_files
import nbformat

nav = mkdocs_gen_files.Nav()

Expand All @@ -45,10 +46,51 @@
# Add to navigation - use .ipynb extension
nav[parts] = doc_path.as_posix()

# Generate the notebook file in the docs directory
with mkdocs_gen_files.open(full_doc_path, "wb") as fd, open(path, "rb") as source_file:
# Write the content of the source file
fd.write(source_file.read())
# Read the notebook
with open(path, encoding="utf-8") as f:
notebook = nbformat.read(f, as_version=4)

# Create a new markdown cell with the source note using HTML
# Create the full URL for the notebook
repo_url = "https://github.com/philip-ndikum/TemporalScope/blob/main"
notebook_relative_path = path.relative_to(root).as_posix() # Convert path to POSIX style for URLs
notebook_name = path.name # Extracts just the notebook file name
source_url = f"{repo_url}/{notebook_relative_path}"

# Create the source note
source_note = (
'<div class="admonition info">\n'
' <p class="admonition-title">Info</p>\n'
" <p>This tutorial was auto-generated from the TemporalScope repository.</p>\n"
" <p>If you would like to suggest enhancements or report issues, please submit a Pull Request following the contribution guidelines.</p>\n"
f' <p>Source notebook: <a href="{source_url}" target="_blank">{notebook_name}</a></p>\n'
"</div>\n"
)

# Create a copyright notice and warning
disclaimer_notice = (
'<div class="admonition danger">\n'
' <p class="admonition-title">Disclaimer & Copyright</p>\n'
' <p>THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE '
"WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR "
"COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES, OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT, OR OTHERWISE, "
"ARISING FROM, OUT OF, OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</p>\n"
" <p>THIS SOFTWARE IS INTENDED FOR ACADEMIC AND INFORMATIONAL PURPOSES ONLY. IT SHOULD NOT BE USED IN PRODUCTION ENVIRONMENTS "
"OR FOR CRITICAL DECISION-MAKING WITHOUT PROPER VALIDATION. ANY USE OF THIS SOFTWARE IS AT THE USER'S OWN RISK.</p>\n"
"<hr/>\n"
"<p>&copy; 2024 Philip Ndikum</p>\n"
"</div>\n"
)

# Add source note and disclaimer cells
new_source_cell = nbformat.v4.new_markdown_cell(source_note)
new_disclaimer_cell = nbformat.v4.new_markdown_cell(disclaimer_notice)
notebook.cells.append(new_source_cell)
notebook.cells.append(new_disclaimer_cell)

# Generate the modified notebook file in the docs directory
with mkdocs_gen_files.open(full_doc_path, "w", encoding="utf-8") as fd:
nbformat.write(notebook, fd)

# Set edit path
mkdocs_gen_files.set_edit_path(full_doc_path, path.relative_to(root))
Expand Down

0 comments on commit ad53041

Please sign in to comment.