diff --git a/.cruft.json b/.cruft.json new file mode 100644 index 0000000..7663405 --- /dev/null +++ b/.cruft.json @@ -0,0 +1,24 @@ +{ + "template": "https://github.com/brightway-lca/cookiecutter-brightwaylib", + "commit": "2dd8d2464644700b16636f7b3d71972e5bf6e803", + "checkout": null, + "context": { + "cookiecutter": { + "full_name": "caro_friedberger", + "email": "caroline.friedberger@gmail.com", + "github_username": "cafriedb", + "project_name": "premise_validation", + "package_name": "dopo", + "project_short_description": "A framework for Detecting Outliers in Premise LCA Operations (DOPO)", + "version": "0.0.1", + "use_pytest": "y", + "open_source_license": "MIT", + "copyright_year": "2024", + "_copy_without_render": [ + ".github/*" + ], + "_template": "https://github.com/brightway-lca/cookiecutter-brightwaylib" + } + }, + "directory": null +} diff --git a/.github/workflows/python-package-deploy.yml b/.github/workflows/python-package-deploy.yml new file mode 100644 index 0000000..a188e7d --- /dev/null +++ b/.github/workflows/python-package-deploy.yml @@ -0,0 +1,40 @@ +--- +# Inspired from: +# https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/ +name: Publish Python 🐍 distributions 📦 to PyPI and TestPyPI + +on: + push: + branches: [main, develop] +jobs: + build-n-publish: + name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI + runs-on: ubuntu-latest + permissions: + id-token: write + steps: + - uses: actions/checkout@v4 + - name: Set up Python 3.11 + uses: actions/setup-python@v5 + with: + python-version: "3.11" + - name: Install pypa/build + run: >- + python -m + pip install + build + --user + - name: Build a binary wheel and a source tarball + run: >- + python -m + build + --outdir dist/ + . + - name: Publish distribution 📦 to Test PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + repository-url: https://test.pypi.org/legacy/ + skip-existing: true + - name: Publish distribution 📦 to PyPI + if: startsWith(github.ref, 'refs/tags') + uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/.github/workflows/python-test.yml b/.github/workflows/python-test.yml new file mode 100644 index 0000000..571134e --- /dev/null +++ b/.github/workflows/python-test.yml @@ -0,0 +1,62 @@ +--- +# This workflow will install Python dependencies and run tests +# across operating systems, select versions of Python, and user + dev environments +# For more info see: +# https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions + +name: Python 🐍 CI/CD tests + +on: + push: + branches: [main, develop] + paths-ignore: # prevents workflow execution when only these types of files are modified + - "**.md" # wildcards prevent file in any repo dir from trigering workflow + - "**.bib" + - "**.ya?ml" # captures both .yml and .yaml + - "LICENSE" + - ".gitignore" + pull_request: + branches: [main, develop] + types: [opened, reopened] # excludes syncronize to avoid redundant trigger from commits on PRs + paths-ignore: + - "**.md" + - "**.bib" + - "**.ya?ml" + - "LICENSE" + - ".gitignore" + workflow_dispatch: # also allow manual trigger, for testing purposes + +jobs: + build: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, windows-latest, macos-13, ubuntu-20.04, macos-latest, windows-2019] + py-version: ["3.9", "3.10", "3.11", "3.12"] + + steps: + - uses: actions/checkout@v4 + + # general Python setup + - name: Set up Python ${{ matrix.py-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.py-version }} + + - name: Update pip & install testing pkgs + run: | + python -VV + python -m pip install --upgrade pip setuptools wheel + + # install testing + - name: Install package and test deps + run: | + pip install .[testing] # install the package and the testing deps + + - name: Test with pytest + run: | + pytest + + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v4 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9bd9e03 --- /dev/null +++ b/.gitignore @@ -0,0 +1,129 @@ +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +pip-wheel-metadata/ +share/python-wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.nox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +*.py,cover +.hypothesis/ +.pytest_cache/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py +db.sqlite3 +db.sqlite3-journal + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +_build/ + +# PyBuilder +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# IPython +profile_default/ +ipython_config.py + +# pyenv +.python-version + +# pipenv +# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. +# However, in case of collaboration, if having platform-specific dependencies or dependencies +# having no cross-platform support, pipenv may install dependencies that don't work, or not +# install all needed dependencies. +#Pipfile.lock + +# PEP 582; used by e.g. github.com/David-OConnor/pyflow +__pypackages__/ + +# Celery stuff +celerybeat-schedule +celerybeat.pid + +# SageMath parsed files +*.sage.py + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ +.dmypy.json +dmypy.json + +# Pyre type checker +.pyre/ diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..a2ea3a9 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,75 @@ +exclude: '^docs/conf.py' + +repos: +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.5.0 + hooks: + - id: trailing-whitespace + - id: check-added-large-files + - id: check-ast + - id: check-json + - id: check-merge-conflict + - id: check-xml + - id: check-yaml + - id: debug-statements + - id: end-of-file-fixer + - id: requirements-txt-fixer + - id: mixed-line-ending + args: ['--fix=auto'] # replace 'auto' with 'lf' to enforce Linux/Mac line endings or 'crlf' for Windows + +## If you want to avoid flake8 errors due to unused vars or imports: +# - repo: https://github.com/myint/autoflake +# rev: v1.4 +# hooks: +# - id: autoflake +# args: [ +# --in-place, +# --remove-all-unused-imports, +# --remove-unused-variables, +# ] + +# https://github.com/PyCQA/flake8/issues/234 +- repo: https://github.com/john-hen/Flake8-pyproject + rev: 1.2.3 + hooks: + - id: Flake8-pyproject + +- repo: https://github.com/pycqa/isort + rev: 5.13.2 + hooks: + - id: isort + args: [--settings-path=pyproject.toml] + +- repo: https://github.com/psf/black + rev: 24.1.1 + hooks: + - id: black + args: [--config=pyproject.toml] + +## If like to embrace black styles even in the docs: +# - repo: https://github.com/asottile/blacken-docs +# rev: v1.12.0 +# hooks: +# - id: blacken-docs +# additional_dependencies: [black] + +- repo: https://github.com/PyCQA/flake8 + rev: 7.0.0 + hooks: + - id: flake8 + additional_dependencies: [Flake8-pyproject] + # You can add flake8 plugins via `additional_dependencies`: + # additional_dependencies: [flake8-bugbear] + +- repo: local + hooks: + - id: pylint + name: pylint + entry: pylint + language: system + types: [python] + args: + [ + "-rn", # Only display messages + "-sn", # Don't display the score + ] diff --git a/.readthedocs.yml b/.readthedocs.yml new file mode 100644 index 0000000..ab0d333 --- /dev/null +++ b/.readthedocs.yml @@ -0,0 +1,20 @@ +# .readthedocs.yaml +# Read the Docs configuration file +# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details + +# Required +version: 2 + +conda: + environment: docs/environment.yaml + +sphinx: + configuration: docs/conf.py + +submodules: + include: all + +build: + os: "ubuntu-lts-latest" # https://docs.readthedocs.io/en/stable/config-file/v2.html#build-os + tools: + python: "mambaforge-latest" # https://docs.readthedocs.io/en/stable/config-file/v2.html#build-tools-python, mamba instead of conda for better build performance \ No newline at end of file diff --git a/CHANGES.md b/CHANGES.md new file mode 100644 index 0000000..cddc27f --- /dev/null +++ b/CHANGES.md @@ -0,0 +1,16 @@ +# `dopo` Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [Unreleased] + +## [0.1.0] - 2022-03-22 + +### Added + +### Changed + +### Removed diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..ed17902 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,76 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, sex characteristics, gender identity and expression, +level of experience, education, socio-economic status, nationality, personal +appearance, race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team at cmutel@gmail.com. All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. The project team is +obligated to maintain confidentiality with regard to the reporter of an incident. +Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, +available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html + +[homepage]: https://www.contributor-covenant.org + +For answers to common questions about this code of conduct, see +https://www.contributor-covenant.org/faq diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..7027493 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,111 @@ +# Contributor Guide + +Thank you for your interest in improving this project. +This project is open-source under the [MIT][License] and +welcomes contributions in the form of bug reports, feature requests, and pull requests. + +Here is a list of important resources for contributors: + +- [Source Code][Source Code] +- [Documentation][Documentation] +- [Issue Tracker][Issue Tracker] +- [Code of Conduct][Code of Conduct] + +[License]: https://opensource.org/licenses/MIT +[Source Code]: https://github.com/cafriedb/premise_validation +[Documentation]: https://premise_validation.readthedocs.io/ +[Issue Tracker]: https://github.com/cafriedb/premise_validation/issues + +## How to report a bug + +Report bugs on the [Issue Tracker][Issue Tracker]. + +When filing an issue, make sure to answer these questions: + +- Which operating system and Python version are you using? +- Which version of this project are you using? +- What did you do? +- What did you expect to see? +- What did you see instead? + +The best way to get your bug fixed is to provide a test case, +and/or steps to reproduce the issue. + +## How to request a feature + +Request features on the [Issue Tracker][Issue Tracker]. + +## How to set up your development environment + +Install the package with development requirements: + +```console +$ pip install -e ".[dev]" +``` + +## How to build the documentation locally + +Make sure you have installed the `dev` and `docs` extras of the package. + +```console +$ pip install -e ".[dev,docs]" +``` + +Build the documentation providing the `docs` directory at the root of the project as the source +and specifying the output directory. + +```console +# use docs as source and docs/_build as output +sphinx-build docs docs/_build +``` + +## How to test the project + + +1. Install the package with development requirements: + +```console +$ pip install -e ".[testing]" +``` + +2. Run the full test suite: + +```console +$ pytest +``` + + +Unit tests are located in the _tests_ directory, +and are written using the [pytest][pytest] testing framework. + +[pytest]: https://pytest.readthedocs.io/ + +## How to submit changes + +Open a [pull request] to submit changes to this project. + +Your pull request needs to meet the following guidelines for acceptance: + +- The test suite must pass without errors and warnings. +- Include unit tests. +- If your changes add functionality, update the documentation accordingly. + +To run linting and code formatting checks before committing your change, you can install pre-commit as a Git hook by running one of following commands, depending on your dependencies manager: + +```console +# conda or mamba +$ conda install pre-commit +``` + +or + +``` +$ pip install pre-commit +``` + + +It is recommended to open an issue before starting work on anything. +This will allow a chance to talk it over with the owners and validate your approach. + +[pytest]: https://pytest.readthedocs.io/ +[pull request]: https://github.com/cafriedb/premise_validation/pulls \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..a2218d2 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright © 2024 caro_friedberger + +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: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +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. diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..e69de29 diff --git a/README.md b/README.md new file mode 100644 index 0000000..0a4072f --- /dev/null +++ b/README.md @@ -0,0 +1,72 @@ +# premise_validation + +[![PyPI](https://img.shields.io/pypi/v/premise_validation.svg)][pypi status] +[![Status](https://img.shields.io/pypi/status/premise_validation.svg)][pypi status] +[![Python Version](https://img.shields.io/pypi/pyversions/premise_validation)][pypi status] +[![License](https://img.shields.io/pypi/l/premise_validation)][license] + +[![Read the documentation at https://premise_validation.readthedocs.io/](https://img.shields.io/readthedocs/premise_validation/latest.svg?label=Read%20the%20Docs)][read the docs] +[![Tests](https://github.com/cafriedb/premise_validation/actions/workflows/python-test.yml/badge.svg)][tests] +[![Codecov](https://codecov.io/gh/cafriedb/premise_validation/branch/main/graph/badge.svg)][codecov] + +[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)][pre-commit] +[![Black](https://img.shields.io/badge/code%20style-black-000000.svg)][black] + +[pypi status]: https://pypi.org/project/premise_validation/ +[read the docs]: https://premise_validation.readthedocs.io/ +[tests]: https://github.com/cafriedb/premise_validation/actions?workflow=Tests +[codecov]: https://app.codecov.io/gh/cafriedb/premise_validation +[pre-commit]: https://github.com/pre-commit/pre-commit +[black]: https://github.com/psf/black + +## Installation + +You can install _dopo_ via [pip] from [PyPI]: + +```console +$ pip install dopo +``` + +## Contributing + +Contributions are very welcome. +To learn more, see the [Contributor Guide][Contributor Guide]. + +## License + +Distributed under the terms of the [MIT license][License], +_dopo_ is free and open source software. + +## Issues + +If you encounter any problems, +please [file an issue][Issue Tracker] along with a detailed description. + + + + +[command-line reference]: https://premise_validation.readthedocs.io/en/latest/usage.html +[License]: https://github.com/cafriedb/premise_validation/blob/main/LICENSE +[Contributor Guide]: https://github.com/cafriedb/premise_validation/blob/main/CONTRIBUTING.md +[Issue Tracker]: https://github.com/cafriedb/premise_validation/issues + + +## Building the Documentation + +You can build the documentation locally by installing the documentation Conda environment: + +```bash +conda env create -f docs/environment.yml +``` + +activating the environment + +```bash +conda activate sphinx_premise_validation +``` + +and [running the build command](https://www.sphinx-doc.org/en/master/man/sphinx-build.html#sphinx-build): + +```bash +sphinx-build docs _build/html --builder=html --jobs=auto --write-all; open _build/html/index.html +``` \ No newline at end of file diff --git a/docs/conf.py b/docs/conf.py new file mode 100644 index 0000000..98c4b02 --- /dev/null +++ b/docs/conf.py @@ -0,0 +1,118 @@ +# conf.py +# Sphinx configuration file +# https://www.sphinx-doc.org/en/master/usage/configuration.html + +### import setup ################################################################################## + +import datetime + +### project information ########################################################################### + +project = "premise_validation" +author = "Brightway Developers" +copyright = datetime.date.today().strftime("%Y") + ' Brightway Developers' + +### project configuration ######################################################################### + +extensions = [ + # native extensions + 'sphinx.ext.autodoc', + 'sphinx.ext.autosummary', + 'sphinx.ext.mathjax', + 'sphinx.ext.viewcode', + 'sphinx.ext.intersphinx', + 'sphinx.ext.extlinks', + # theme + 'sphinx_rtd_theme', + # Markdown support + 'myst_parser', + # API documentation support + 'autoapi', + # responsive web component support + 'sphinx_design', + # copy button on code blocks + "sphinx_copybutton", +] + +exclude_patterns = ['_build'] + +# The master toctree document. +master_doc = 'index' + +### intersphinx configuration ###################################################################### + +intersphinx_mapping = { + "bw": ("https://docs.brightway.dev/en/latest/", None), +} + +### theme configuration ############################################################################ + +html_theme = "sphinx_rtd_theme" +html_title = "premise_validation" +html_show_sphinx = False + +html_theme_options = { + 'logo_only': False, + 'display_version': True, + 'prev_next_buttons_location': 'bottom', + # Toc options + 'collapse_navigation': True, + 'sticky_navigation': True, + 'navigation_depth': 4, + 'includehidden': True, + 'titles_only': False +} + +html_logo = 'https://raw.githubusercontent.com/brightway-lca/brightway-documentation/main/source/_static/logo/BW_all_white_transparent_landscape_wide.svg' +html_favicon = 'https://github.com/brightway-lca/brightway-documentation/blob/main/source/_static/logo/BW_favicon_500x500.png' + +### extension configuration ######################################################################## + +## myst_parser configuration ############################################ +## https://myst-parser.readthedocs.io/en/latest/configuration.html + +source_suffix = { + '.rst': 'restructuredtext', + '.md': 'markdown', +} + +myst_enable_extensions = [ + "amsmath", + "colon_fence", + "deflist", + "dollarmath", + "html_image", +] + +## autoapi configuration ################################################ +## https://sphinx-autoapi.readthedocs.io/en/latest/reference/config.html#customisation-options + +autoapi_options = [ + 'members', + 'undoc-members', + 'private-members', + 'show-inheritance', + 'show-module-summary', +] + +autoapi_python_class_content = 'both' +autoapi_member_order = 'groupwise' +autoapi_root = 'content/api' +autoapi_keep_files = False + +autoapi_dirs = [ + '../dopo', +] + +autoapi_ignore = [ + '*/data/*', + '*tests/*', + '*tests.py', + '*validation.py', + '*version.py', + '*.rst', + '*.yml', + '*.md', + '*.json', + '*.data' +] \ No newline at end of file diff --git a/docs/content/changelog.md b/docs/content/changelog.md new file mode 100644 index 0000000..8b1749d --- /dev/null +++ b/docs/content/changelog.md @@ -0,0 +1,2 @@ +```{include} ../../CHANGES.md +``` diff --git a/docs/content/codeofconduct.md b/docs/content/codeofconduct.md new file mode 100644 index 0000000..cc6912b --- /dev/null +++ b/docs/content/codeofconduct.md @@ -0,0 +1,2 @@ +```{include} ../../CODE_OF_CONDUCT.md +``` diff --git a/docs/content/contributing.md b/docs/content/contributing.md new file mode 100644 index 0000000..8f73527 --- /dev/null +++ b/docs/content/contributing.md @@ -0,0 +1 @@ +```{include} ../../CONTRIBUTING.md \ No newline at end of file diff --git a/docs/content/license.md b/docs/content/license.md new file mode 100644 index 0000000..00eca8b --- /dev/null +++ b/docs/content/license.md @@ -0,0 +1,7 @@ +# License + +```{literalinclude} ../../LICENSE +--- +language: none +--- +``` diff --git a/docs/content/usage.md b/docs/content/usage.md new file mode 100644 index 0000000..fc56ab5 --- /dev/null +++ b/docs/content/usage.md @@ -0,0 +1 @@ +# Usage \ No newline at end of file diff --git a/docs/environment.yaml b/docs/environment.yaml new file mode 100644 index 0000000..cdd65fe --- /dev/null +++ b/docs/environment.yaml @@ -0,0 +1,25 @@ +# environment.yaml +# Conda environment file for Read the Docs build of the Sphinx project +# https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#creating-an-environment-file-manually + +name: sphinx_premise_validation +channels: + - conda-forge + - nodefaults +dependencies: + # core functionality + - python + - ipython + # sphinx + - sphinx # core builder # https://anaconda.org/conda-forge/sphinx/files + # them + - sphinx_rtd_theme # theme # https://anaconda.org/conda-forge/sphinx_rtd_theme/files + # extensions + - myst-parser # Markdown support # https://anaconda.org/conda-forge/myst-parser/files + - sphinx-design # responsive web component support # https://anaconda.org/conda-forge/sphinx-design/files + - sphinx-copybutton # for copy button in code blocks # https://anaconda.org/conda-forge/sphinx-copybutton/files + - sphinx-autoapi # to build docs from source code instead of package import # https://anaconda.org/conda-forge/sphinx-autoapi/files + - sphinx-notfound-page # custom 404 page # https://anaconda.org/conda-forge/sphinx-notfound-page/files + - sphinx-copybutton # for copy button in code blocks # https://anaconda.org/conda-forge/sphinx-copybutton/files + # build process + - sphinx-autobuild # live-html support # https://anaconda.org/conda-forge/sphinx-autobuild/files \ No newline at end of file diff --git a/docs/index.md b/docs/index.md new file mode 100644 index 0000000..b2df43f --- /dev/null +++ b/docs/index.md @@ -0,0 +1,21 @@ +# premise_validation + +```{button-link} https://docs.brightway.dev +:color: info +:expand: +{octicon}`light-bulb;1em` premise_validation is a specialized package of the Brightway Software Framework +``` + +```{toctree} +--- +hidden: +maxdepth: 1 +--- +self +content/usage +content/api/index +content/codeofconduct +content/contributing +content/license +content/changelog +``` diff --git a/dopo/__init__.py b/dopo/__init__.py new file mode 100644 index 0000000..172c023 --- /dev/null +++ b/dopo/__init__.py @@ -0,0 +1,8 @@ +"""dopo.""" + +__all__ = ( + "__version__", + # Add functions and variables you want exposed in `dopo.` namespace here +) + +__version__ = "0.0.1" diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..2624a62 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,101 @@ +[build-system] +requires = ["setuptools>=68.0"] +build-backend = "setuptools.build_meta" + +[project] +name = "dopo" +authors = [ + { name="caro_friedberger", email="caroline.friedberger@gmail.com" } +] +maintainers = [ + { name="caro_friedberger", email="caroline.friedberger@gmail.com" } +] +description = "A framework for Detecting Outliers in Premise LCA Operations (DOPO)" +readme = "README.md" +dynamic = ["version"] +# Add here all kinds of additional classifiers as defined under +# https://pypi.org/classifiers/ +classifiers = [ + "Development Status :: 4 - Beta", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Natural Language :: English", + "Operating System :: OS Independent", + "Topic :: Scientific/Engineering" +] +requires-python = ">=3.9" +dependencies = [ + # dependencies as strings with quotes, e.g. "foo" + # You can add version requirements like "foo>2.0" +] + +[project.urls] +source = "https://github.com/cafriedb/premise_validation" +homepage = "https://github.com/cafriedb/premise_validation" +tracker = "https://github.com/cafriedb/premise_validation/issues" + +[project.optional-dependencies] +# Getting recursive dependencies to work is a pain, this +# seems to work, at least for now +testing = [ + "dopo", + "pytest", + "pytest-cov", + "python-coveralls" +] +dev = [ + "build", + "pre-commit", + "pylint", + "pytest", + "pytest-cov", + "pytest-randomly", + "setuptools", +] + +[tool.setuptools] +license-files = ["LICENSE"] +include-package-data = true +packages = ["dopo"] + +[tool.setuptools.dynamic] +version = {attr = "dopo.__version__"} + +[tool.pytest.ini_options] +addopts = "--cov dopo --cov-report term-missing --verbose" +norecursedirs = [ + "dist", + "build", + ".tox" +] +testpaths = ["tests/*.py"] + +[tool.flake8] +# Some sane defaults for the code style checker flake8 +max_line_length = 88 +extend_ignore = ["E203", "W503"] +# ^ Black-compatible +# E203 and W503 have edge cases handled by black +exclude = [ + ".tox", + "build", + "dist", + ".eggs", + "docs/conf.py", +] + +[tool.black] +line-length = 88 + +[tool.isort] +profile = "black" +line_length = 88 +multi_line_output = 3 +include_trailing_comma = true +force_grid_wrap = 0 +use_parentheses = true +ensure_newline_before_comments = true diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 0000000..8fef2b9 --- /dev/null +++ b/tests/__init__.py @@ -0,0 +1 @@ +"""Test suite for the dopo package.""" diff --git a/tests/conftest.py b/tests/conftest.py new file mode 100644 index 0000000..873a515 --- /dev/null +++ b/tests/conftest.py @@ -0,0 +1,3 @@ +"""Fixtures for dopo""" + +# import pytest