From fe0f80b8c3ded92e6efbbe4de2b5626551637b1b Mon Sep 17 00:00:00 2001 From: Fabian Joswig Date: Fri, 10 Mar 2023 14:25:17 +0000 Subject: [PATCH 1/4] docs: README and CONTRIBUTING updated. --- CONTRIBUTING.md | 14 +++++--------- README.md | 4 +++- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b5cd207e..c1c92647 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -4,28 +4,24 @@ If you want to contribute to `pyerrors` please [fork](https://docs.github.com/en ``` git clone http://github.com/my_username/pyerrors.git --branch develop ``` -and create your own branch +and create your own branch for the feature or bug fix ``` cd pyerrors git checkout -b feature/my_feature ``` -It can be convenient to install the package in editable mode in the local python environment when developing new features -``` -pip install -e . -``` Please send any pull requests to the `develop` branch. ### Documentation -Please add docstrings to any new function, class or method you implement. The documentation is automatically generated from these docstrings. The startpage of the documentation is generated from the docstring of `pyerrors/__init__.py`. +Please add docstrings to any new function, class or method you implement. The documentation is automatically generated from these docstrings. We follow the [numpydoc style](https://numpydoc.readthedocs.io/en/latest/format.html) for docstrings. The startpage of the documentation is generated from the docstring of `pyerrors/__init__.py`. ### Tests When implementing a new feature or fixing a bug please add meaningful tests to the files in the `tests` directory which cover the new code. For all pull requests tests are executed for the most recent python releases via ``` -pytest -vv --cov=pyerrors -pytest -vv --nbmake examples/*.ipynb +pytest +pytest --nbmake examples/*.ipynb ``` -requiring `pytest`, `pytest-cov`, `pytest-benchmark`, `hypothesis' and `nbmake`. To install the test dependencies one can run `pip install pyerrors[test]` +requiring `pytest`, `pytest-cov`, `pytest-benchmark`, `hypothesis` and `nbmake`. To install the test dependencies one can run `pip install pyerrors[test]` To get a coverage report in html run ``` diff --git a/README.md b/README.md index 5368ee34..bc9bcef1 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,6 @@ - **Documentation:** https://fjosw.github.io/pyerrors/pyerrors.html - **Examples:** https://github.com/fjosw/pyerrors/tree/develop/examples -- **Contributing:** https://github.com/fjosw/pyerrors/blob/develop/CONTRIBUTING.md - **Bug reports:** https://github.com/fjosw/pyerrors/issues ## Installation @@ -17,3 +16,6 @@ to install the current `develop` version run ```bash pip install git+https://github.com/fjosw/pyerrors.git@develop ``` + +## Contributing +We appreciate all contributions to the code, the documentation and the examples. If you want to get involved please have a look at our [contribution guideline](https://github.com/fjosw/pyerrors/blob/develop/CONTRIBUTING.md). From d8fb683262048a8ce8cf034f96198a5f37bd9370 Mon Sep 17 00:00:00 2001 From: Fabian Joswig Date: Fri, 10 Mar 2023 14:37:50 +0000 Subject: [PATCH 2/4] docs: CONTRIBUTING.md extended. --- CONTRIBUTING.md | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c1c92647..bfe66228 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,15 +1,18 @@ -# Development +# Contributing + +If you are new to contributing to open source software [this guide](https://opensource.guide/how-to-contribute) can help get you started. + ### Setup -If you want to contribute to `pyerrors` please [fork](https://docs.github.com/en/get-started/quickstart/fork-a-repo) `pyerrors` on Github, clone the current `develop` branch +If you want to contribute to `pyerrors` please [fork](https://docs.github.com/en/get-started/quickstart/fork-a-repo) `pyerrors` on Github, clone the repository ``` -git clone http://github.com/my_username/pyerrors.git --branch develop +git clone http://github.com/my_username/pyerrors.git ``` and create your own branch for the feature or bug fix ``` cd pyerrors git checkout -b feature/my_feature ``` -Please send any pull requests to the `develop` branch. +After committing your changes please send a pull requests to the `develop` branch. A guide on how to create a pull request can be found [here](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request). ### Documentation Please add docstrings to any new function, class or method you implement. The documentation is automatically generated from these docstrings. We follow the [numpydoc style](https://numpydoc.readthedocs.io/en/latest/format.html) for docstrings. The startpage of the documentation is generated from the docstring of `pyerrors/__init__.py`. @@ -31,4 +34,4 @@ The linter `flake8` is executed with the command ``` flake8 --ignore=E501,W503 --exclude=__init__.py pyerrors ``` -Please make sure that all tests are passed for a new pull requests. +Please make sure that all tests pass for a new pull requests. From 8ed5ce9569e019ce3df55e4f8c5a0a24b8979893 Mon Sep 17 00:00:00 2001 From: Fabian Joswig Date: Sat, 11 Mar 2023 21:17:09 +0000 Subject: [PATCH 3/4] feat: print_config function added to help with debugging. --- pyerrors/__init__.py | 2 +- pyerrors/version.py | 22 +++++++++++++++++++++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/pyerrors/__init__.py b/pyerrors/__init__.py index b82eb7f8..153ef1b2 100644 --- a/pyerrors/__init__.py +++ b/pyerrors/__init__.py @@ -465,4 +465,4 @@ from . import linalg from . import mpm from . import roots -from .version import __version__ +from .version import __version__, print_config diff --git a/pyerrors/version.py b/pyerrors/version.py index eedcdd45..cc4bcc41 100644 --- a/pyerrors/version.py +++ b/pyerrors/version.py @@ -1 +1,21 @@ -__version__ = "2.7.0+dev" +import platform +import numpy as np +import scipy +import matplotlib +import pandas as pd + + +__version__ = "2.7.0-dev" + + +def print_config(): + """Print information about version of python, pyerrors and dependencies.""" + config = {"python": platform.python_version(), + "pyerrors": __version__, + "numpy": np.__version__, + "scipy": scipy.__version__, + "matplotlib": matplotlib.__version__, + "pandas": pd.__version__} + + for key, value in config.items(): + print(f"{key : <10}\t {value}") From 0044f90315b2c06685d3d098ee352b5f96749f47 Mon Sep 17 00:00:00 2001 From: Fabian Joswig Date: Sat, 11 Mar 2023 21:22:03 +0000 Subject: [PATCH 4/4] feat: print_config moved to misc. --- pyerrors/__init__.py | 2 +- pyerrors/misc.py | 20 +++++++++++++++++++- pyerrors/version.py | 20 -------------------- 3 files changed, 20 insertions(+), 22 deletions(-) diff --git a/pyerrors/__init__.py b/pyerrors/__init__.py index 153ef1b2..b82eb7f8 100644 --- a/pyerrors/__init__.py +++ b/pyerrors/__init__.py @@ -465,4 +465,4 @@ from . import linalg from . import mpm from . import roots -from .version import __version__, print_config +from .version import __version__ diff --git a/pyerrors/misc.py b/pyerrors/misc.py index 962b91c5..07fc8fe1 100644 --- a/pyerrors/misc.py +++ b/pyerrors/misc.py @@ -1,7 +1,25 @@ -import pickle +import platform import numpy as np +import scipy +import matplotlib import matplotlib.pyplot as plt +import pandas as pd +import pickle from .obs import Obs +from .version import __version__ + + +def print_config(): + """Print information about version of python, pyerrors and dependencies.""" + config = {"python": platform.python_version(), + "pyerrors": __version__, + "numpy": np.__version__, + "scipy": scipy.__version__, + "matplotlib": matplotlib.__version__, + "pandas": pd.__version__} + + for key, value in config.items(): + print(f"{key : <10}\t {value}") def errorbar(x, y, axes=plt, **kwargs): diff --git a/pyerrors/version.py b/pyerrors/version.py index cc4bcc41..3e4e49a9 100644 --- a/pyerrors/version.py +++ b/pyerrors/version.py @@ -1,21 +1 @@ -import platform -import numpy as np -import scipy -import matplotlib -import pandas as pd - - __version__ = "2.7.0-dev" - - -def print_config(): - """Print information about version of python, pyerrors and dependencies.""" - config = {"python": platform.python_version(), - "pyerrors": __version__, - "numpy": np.__version__, - "scipy": scipy.__version__, - "matplotlib": matplotlib.__version__, - "pandas": pd.__version__} - - for key, value in config.items(): - print(f"{key : <10}\t {value}")