From 28df51d172d38ef0d0c851dc22e9a2146eadafe4 Mon Sep 17 00:00:00 2001 From: Emmanuel Bourret Date: Wed, 1 Jul 2026 15:21:46 -0400 Subject: [PATCH 1/2] DOC: add PR/issue templates, contributing guidelines, and switch to BSD 3-Clause Templates and contributing guidelines adapted from derb12/pybaselines. License changed from MIT to BSD 3-Clause. --- .github/ISSUE_TEMPLATE/bug-report.md | 37 ++++++++++++++++++++ .github/ISSUE_TEMPLATE/config.yml | 1 + .github/ISSUE_TEMPLATE/feature_request.md | 13 +++++++ .github/PULL_REQUEST_TEMPLATE.md | 34 ++++++++++++++++++ CONTRIBUTING.md | 41 ++++++++++++++++++++++ LICENSE | 42 ++++++++++++++--------- pyproject.toml | 1 + 7 files changed, 152 insertions(+), 17 deletions(-) create mode 100644 .github/ISSUE_TEMPLATE/bug-report.md create mode 100644 .github/ISSUE_TEMPLATE/config.yml create mode 100644 .github/ISSUE_TEMPLATE/feature_request.md create mode 100644 .github/PULL_REQUEST_TEMPLATE.md create mode 100644 CONTRIBUTING.md diff --git a/.github/ISSUE_TEMPLATE/bug-report.md b/.github/ISSUE_TEMPLATE/bug-report.md new file mode 100644 index 0000000..f62b0ca --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug-report.md @@ -0,0 +1,37 @@ +--- +name: Bug Report +about: Submit an issue with the project +title: '' + +--- + +### Description + + + +### Your Setup + + +* Operating System: +* Python version: +* spectroplot version: + +### Example Code + + +```bash +# Paste the command you ran and the output. + +``` + +### Error Message + +``` +# Paste the complete error traceback here, if an error occurred. +``` diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..3ba13e0 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1 @@ +blank_issues_enabled: false diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..6bccb12 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,13 @@ +--- +name: Feature request +about: Suggest a feature/idea for this project +title: '' + +--- + +### Description of the problem/new feature + + + +### Description of a possible solution or alternative + diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..531a16a --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,34 @@ + + +### Description + + + +### Type of Pull Request + + +- [ ] Bug Fix +- [ ] New Feature +- [ ] Miscellaneous Changes (refactor, code improvements, etc.) +- [ ] Documentation or Example Programs + +### Pull Request Checklist + + +- [ ] New code and/or documentation is valid for use with the BSD 3-Clause license. +- [ ] New code is fully documented with docstrings that follow Numpy style, + if applicable. +- [ ] New code follows package conventions (max 80 chars per line, etc.), + if applicable. +- [ ] Added/updated tests and ensured they pass locally, if applicable. +- [ ] Verified that `ruff check src/` passes, if applicable. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..e31abbb --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,41 @@ +# Contributing to spectroplot + +Thank you for your interest in contributing! + +## Reporting issues + +- Use the issue templates for bug reports and feature requests. +- Include a minimal, complete, and verifiable example. +- Include your Python version, OS, and spectroplot version. + +## Pull requests + +- Open an issue first to discuss changes before submitting a PR. +- Keep changes focused — one PR per feature/bugfix. +- Follow the existing code style: 80-character line limit, Numpy-style + docstrings, descriptive variable names. +- Write tests for new functionality and ensure all tests pass: + +``` +pytest tests/ +``` + +- Run Ruff before submitting: + +``` +ruff check src/ +``` + +## Code style + +- Maximum line length: 80 characters. +- Docstrings follow the Numpy documentation style. +- Imports: standard library, third-party, local — each group separated + by a blank line. +- No commented-out code; remove dead code. +- Prefer ``np.asarray(..., dtype=float)`` over implicit list coercion. + +## Licensing + +By contributing, you agree that your contributions will be licensed +under the project's BSD 3-Clause license. diff --git a/LICENSE b/LICENSE index 7983e99..ab3268d 100644 --- a/LICENSE +++ b/LICENSE @@ -1,21 +1,29 @@ -MIT License +BSD 3-Clause License -Copyright (c) 2026 Emmanuel Bourret +Copyright (c) 2026, Emmanuel Bourret +All rights reserved. -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. -THE 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. +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/pyproject.toml b/pyproject.toml index bfea88b..eda9a3d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,6 +7,7 @@ name = "spectroplot" version = "0.1.0" description = "Plot optical spectra from ORCA output, spectrum, and ESD root files" requires-python = ">=3.10" +license = {text = "BSD-3-Clause"} dependencies = [ "numpy>=1.21", "pandas>=1.3", From 00930a1a25d8d9d5a34f32493dbbf8b96a34fe67 Mon Sep 17 00:00:00 2001 From: Emmanuel Bourret Date: Wed, 1 Jul 2026 15:27:45 -0400 Subject: [PATCH 2/2] DOC: add author header to all source and test files Each file now has a module-level docstring with description, creation date, and @author: Emmanuel Bourret. --- src/spectroplot/__init__.py | 3 +++ src/spectroplot/__main__.py | 6 ++++++ src/spectroplot/_patterns.py | 6 +++++- src/spectroplot/data_reader.py | 6 ++++++ src/spectroplot/functions.py | 6 ++++++ src/spectroplot/global_constants.py | 3 +++ src/spectroplot/spectroplot.py | 6 ++++++ tests/test_data_reader.py | 6 ++++++ tests/test_functions.py | 6 ++++++ tests/test_integration.py | 6 ++++++ 10 files changed, 53 insertions(+), 1 deletion(-) diff --git a/src/spectroplot/__init__.py b/src/spectroplot/__init__.py index 72f2a3c..853f595 100644 --- a/src/spectroplot/__init__.py +++ b/src/spectroplot/__init__.py @@ -6,6 +6,9 @@ Class for reading and parsing spectrum files. main CLI entry point. + +Created on June 30, 2026 +@author: Emmanuel Bourret """ from spectroplot.data_reader import SpectrumData as SpectrumData diff --git a/src/spectroplot/__main__.py b/src/spectroplot/__main__.py index 9554d37..fdd9d8b 100644 --- a/src/spectroplot/__main__.py +++ b/src/spectroplot/__main__.py @@ -1,3 +1,9 @@ +"""Allows ``python -m spectroplot`` to invoke the CLI entry point. + +Created on June 30, 2026 +@author: Emmanuel Bourret +""" + from spectroplot import main main() diff --git a/src/spectroplot/_patterns.py b/src/spectroplot/_patterns.py index cc01451..56229e8 100644 --- a/src/spectroplot/_patterns.py +++ b/src/spectroplot/_patterns.py @@ -1,4 +1,8 @@ -"""Compiled regular expressions shared across modules.""" +"""Compiled regular expressions shared across modules. + +Created on July 1, 2026 +@author: Emmanuel Bourret +""" import re from spectroplot.global_constants import RE_SPECTRUM_ROOT_PATTERN diff --git a/src/spectroplot/data_reader.py b/src/spectroplot/data_reader.py index 2272f83..d77f3bf 100644 --- a/src/spectroplot/data_reader.py +++ b/src/spectroplot/data_reader.py @@ -1,3 +1,9 @@ +"""Reader for ORCA output, experimental, and ESD spectrum files. + +Created on January 10, 2026 +@author: Emmanuel Bourret +""" + import logging import re #regex diff --git a/src/spectroplot/functions.py b/src/spectroplot/functions.py index 54d1332..d190c01 100644 --- a/src/spectroplot/functions.py +++ b/src/spectroplot/functions.py @@ -1,3 +1,9 @@ +"""Utility functions for spectrum processing and plotting. + +Created on January 10, 2026 +@author: Emmanuel Bourret +""" + from typing import Optional import numpy as np #element-wise tensor processing import pandas as pd #dataframe processing diff --git a/src/spectroplot/global_constants.py b/src/spectroplot/global_constants.py index d0ae146..ca5f594 100644 --- a/src/spectroplot/global_constants.py +++ b/src/spectroplot/global_constants.py @@ -1,5 +1,8 @@ """Global constants and default configuration for spectroplot. +Created on January 10, 2026 +@author: Emmanuel Bourret + All-capitals names are true constants. Lowercase names are user-configurable defaults that can be overridden via CLI flags or by modifying this file directly. diff --git a/src/spectroplot/spectroplot.py b/src/spectroplot/spectroplot.py index 028eaff..de323f7 100644 --- a/src/spectroplot/spectroplot.py +++ b/src/spectroplot/spectroplot.py @@ -1,3 +1,9 @@ +"""Entry point and plotting functions for the spectroplot CLI. + +Created on June 30, 2026 +@author: Emmanuel Bourret +""" + import sys #sys files processing from typing import Optional from pathlib import Path #path processing diff --git a/tests/test_data_reader.py b/tests/test_data_reader.py index 34be1d6..ca30c1e 100644 --- a/tests/test_data_reader.py +++ b/tests/test_data_reader.py @@ -1,3 +1,9 @@ +"""Tests for the SpectrumData file reader. + +Created on June 29, 2026 +@author: Emmanuel Bourret +""" + import sys sys.path.insert(0, "src") diff --git a/tests/test_functions.py b/tests/test_functions.py index 5307373..d81109b 100644 --- a/tests/test_functions.py +++ b/tests/test_functions.py @@ -1,3 +1,9 @@ +"""Tests for spectrum processing utility functions. + +Created on June 29, 2026 +@author: Emmanuel Bourret +""" + import numpy as np import pandas as pd import sys diff --git a/tests/test_integration.py b/tests/test_integration.py index 62876de..d6c58dc 100644 --- a/tests/test_integration.py +++ b/tests/test_integration.py @@ -1,3 +1,9 @@ +"""Integration tests for the full spectroplot pipeline. + +Created on June 30, 2026 +@author: Emmanuel Bourret +""" + import sys from pathlib import Path from unittest.mock import MagicMock, patch