diff --git a/.codecov.yml b/.codecov.yml index 20ad66b..04dd651 100644 --- a/.codecov.yml +++ b/.codecov.yml @@ -1,10 +1,34 @@ -# show coverage in CI status, not as a comment. -comment: off +# codecov can find this file anywhere in the repo, so we don't need to clutter +# the root folder. +#comment: false + +codecov: + notify: + require_ci_to_pass: no + coverage: status: - project: - default: - target: auto patch: default: + target: '70' + if_no_uploads: error + if_not_found: success + if_ci_failed: failure + project: + default: false + library: target: auto + if_no_uploads: error + if_not_found: success + if_ci_failed: error + paths: '!*/tests/.*' + + tests: + target: 97.9% + paths: '*/tests/.*' + if_not_found: success + +flags: + tests: + paths: + - tests/ diff --git a/.coveragerc b/.coveragerc index 70a00ce..5a5d234 100644 --- a/.coveragerc +++ b/.coveragerc @@ -1,6 +1,6 @@ [run] source = - fourigui + diffpy.fourigui [report] omit = */python?.?/* diff --git a/.gitattributes b/.gitattributes index c15d607..3bfb78e 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1 +1 @@ -fourigui/_version.py export-subst +diffpy.fourigui/_version.py export-subst diff --git a/.gitignore b/.gitignore index 8783249..a25212e 100644 --- a/.gitignore +++ b/.gitignore @@ -24,6 +24,10 @@ venv/ *.egg-info/ .installed.cfg *.egg +bin/ +temp/ +tags/ +errors.err # PyInstaller # Usually these files are written by a python script from a template @@ -34,6 +38,7 @@ venv/ # Installer logs pip-log.txt pip-delete-this-directory.txt +MANIFEST # Unit test / coverage reports htmlcov/ @@ -50,6 +55,11 @@ coverage.xml *.mo *.pot +# Mr Developer +.mr.developer.cfg +.project +.pydevproject + # Django stuff: *.log @@ -64,19 +74,26 @@ docs/source/generated/ target/ # Editor files -#mac +# mac .DS_Store *~ -#vim +# vim *.swp *.swo -#pycharm +# pycharm .idea/ -#VSCode +# VSCode .vscode/ -#Ipython Notebook +# Ipython Notebook .ipynb_checkpoints + +# version information +setup.cfg +/src/diffpy/*/version.cfg + +# Rever +rever/ diff --git a/AUTHORS.rst b/AUTHORS.rst index 37a0f5d..5b5de9f 100644 --- a/AUTHORS.rst +++ b/AUTHORS.rst @@ -1,8 +1,12 @@ +Authors +======= The main contributors to the diffpy.fourigui software is: Sani Harouna-Mayer +Billinge Group and community contributors. + This project was much improved by testing, feedback and suggestions from the Billinge-group members at the Applied Physics and Applied Mathematics Department of the Columbia University in New York and @@ -11,23 +15,16 @@ at the Brookhaven National Laboratory. For more information about diffpy.fourigui email sb2896@columbia.edu. - -======= Credits +======= - Zach Thatcher - Connor Bracy - Silvio Achilles - Ludwig Hendl -======= - -Maintainer ----------- - -* diffpy - Contributors ------------ -None yet. Why not be the first? See: CONTRIBUTING.rst +For a list of contributors, visit +https://github.com/{{ cookiecutter.github_org }}/{{ cookiecutter.repo_name }}/graphs/contributors diff --git a/README.rst b/README.rst index a08d650..235eb39 100644 --- a/README.rst +++ b/README.rst @@ -1,100 +1,139 @@ -======== -diffpy.fourigui -======== +|Icon| |title|_ +=============== -.. image:: https://img.shields.io/travis/sbillinge/fourigui.svg - :target: https://travis-ci.org/sbillinge/fourigui +.. |title| replace:: diffpy.fourigui +.. _title: https://diffpy.github.io/fourigui -.. image:: https://img.shields.io/pypi/v/fourigui.svg - :target: https://pypi.python.org/pypi/fourigui +.. |Icon| image:: https://avatars.githubusercontent.com/diffpy + :target: https://diffpy.github.io/fourigui + :height: 100px +|PyPi| |Forge| |PythonVersion| |PR| -* Free software: 3-clause BSD license -* Documentation: (COMING SOON!) https://sbillinge.github.io/fourigui. +|CI| |Codecov| |Black| |Tracking| -======================================================================== -#TODO insert desciptions -{{Fourigui is an interactive visualization tool with an embedded Fourier transformation functionality, designed to process 3D reciprocal space scattering volumes to 3D atomic pair distribution functions (3D PDFs).}} +.. |Black| image:: https://img.shields.io/badge/code_style-black-black + :target: https://github.com/psf/black -{{Fourigui is a tool to visualize and process 3D data sets written with the python programming language. Fourigui always displays one slice perpendicular to one axis and allows scrolling through the 3D data set along the given axis with a slider. It shows feedback values such as global and local maxima, minima or NAN ratios. The matplotlib panel e.g. for zooming and saving figures is featured. -Fourigui is designed for the processing of 3D atomic pair distribution functions (PDFs). One can load a 3D reciprocal space scattering volume which can be Fourier transformed to the 3D PDF. Thereby, one can apply cut off frequencies beyond and below given Q values, compare the results and switch between the scattering volume in reciprocal space and 3D PDF in real space. -}} -#TODO add docs to website? -To learn more about diffpy.{{cookiecutter.package_name}} library see the -user manual at http://diffpy.github.io/diffpy.{{cookiecutter.package_name}}. +.. |CI| image:: https://github.com/diffpy/fourigui/actions/workflows/main.yml/badge.svg + :target: https://github.com/diffpy/fourigui/actions/workflows/main.yml -REQUIREMENTS ------------------------------------------------------------------------- +.. |Codecov| image:: https://codecov.io/gh/diffpy/fourigui/branch/main/graph/badge.svg + :target: https://codecov.io/gh/diffpy/fourigui -The diffpy.fourigui package requires Python 3.5 or later or 2.7 and +.. |Forge| image:: https://img.shields.io/conda/vn/conda-forge/diffpy.fourigui + :target: https://anaconda.org/conda-forge/diffpy.fourigui + +.. |PR| image:: https://img.shields.io/badge/PR-Welcome-29ab47ff + +.. |PyPi| image:: https://img.shields.io/pypi/v/diffpy.fourigui + :target: https://pypi.org/project/diffpy.fourigui/ + +.. |PythonVersion| image:: https://img.shields.io/pypi/pyversions/diffpy.fourigui + :target: https://pypi.org/project/diffpy.fourigui/ + +.. |Tracking| image:: https://img.shields.io/badge/issue_tracking-github-blue + :target: https://github.com/diffpy/fourigui/issues + +Tool for visualizing 3D diffraction and PDF Images + +Fourigui is an interactive visualization tool with an embedded Fourier transformation functionality, designed to +process 3D reciprocal space scattering volumes to 3D atomic pair distribution functions (3D PDFs). + +Fourigui is a tool to visualize and process 3D data sets written with the python programming language. Fourigui always +displays one slice perpendicular to one axis and allows scrolling through the 3D data set along the given axis with a +slider. It shows feedback values such as global and local maxima, minima or NAN ratios. The matplotlib panel e.g. for +zooming and saving figures is featured. Fourigui is designed for the processing of 3D atomic pair distribution +functions (PDFs). One can load a 3D reciprocal space scattering volume which can be Fourier transformed to the 3D PDF. +Thereby, one can apply cut off frequencies beyond and below given Q values, compare the results and switch between the +scattering volume in reciprocal space and 3D PDF in real space. + + +For more information about the diffpy.fourigui library, please consult our `online documentation `_. + +Citation +-------- +If you use diffpy.fourigui in a scientific publication, we would like you to cite this package as + + diffpy.fourigui Package, https://github.com/diffpy/fourigui + +Installation +------------ +The diffpy.fourigui package requires Python 3.10 or later and the following software: * ``matplotlib`` - graphing tool * ``Scipy`` - scientific computing tool for python * ``h5py`` - pythonic interface to the HDF5 binary data format +The preferred method is to use `Miniconda Python +`_ +and install from the "conda-forge" channel of Conda packages. -We recommend to use `Anaconda Python `_ -as it allows to install all software dependencies together with -diffpy.fourigui. For other Python distributions it is necessary to -install the required software separately. As an example on Ubuntu -Linux the required software can be installed with :: +To add "conda-forge" to the conda channels, run the following in a terminal. :: - sudo get-apt install python3-matplotlib python3-Scipy python3-h5py + conda config --add channels conda-forge +We want to install our packages in a suitable conda environment. +The following creates and activates a new environment named ``diffpy.fourigui_env`` :: -INSTALLATION ------------------------------------------------------------------------- + conda create -n diffpy.fourigui_env python=3 + conda activate diffpy.fourigui_env -The preferred method is to use Anaconda Python and install from the -"conda-forge" channel of Anaconda packages :: +Then, to fully install ``diffpy.fourigui`` in our active environment, run :: - conda config --add channels conda-forge - conda install diffpy.fourigui + conda install diffpy.fourigui -Another installation option is to use ``easy_install`` to download and -install the latest release from -`Python Package Index `_ :: +Another option is to use ``pip`` to download and install the latest release from +`Python Package Index `_. +To install using ``pip`` into your ``diffpy.fourigui_env`` environment, we will also have to install dependencies :: - pip install diffpy.fourigui + pip install -r https://raw.githubusercontent.com/diffpy/fourigui/main/requirements/run.txt -If you prefer to install from sources, navigate to the source archive -directory and run :: +and then install the package :: - python setup.py install + pip install diffpy.fourigui -You may need to use ``sudo`` with system Python so it is allowed to -copy files to system directories. If sudo is not available, check -the usage info from ``python setup.py install --help`` for options to -install to user-writable locations. +If you prefer to install from sources, after installing the dependencies, obtain the source archive from +`GitHub `_. Once installed, ``cd`` into your ``fourigui`` directory +and run the following :: + pip install . -DEVELOPMENT ------------------------------------------------------------------------- - +Support and Contribute +---------------------- diffpy.fourigui is an open-source software developed as a part of the DiffPy-CMI complex modeling initiative at the Brookhaven National -Laboratory. The diffpy.{{cookiecutter.package_name}} sources are hosted at -https://github.com/diffpy/diffpy.fourigui. +Laboratory. + +`Diffpy user group `_ is the discussion forum for general questions and discussions about the use of diffpy.fourigui. Please join the diffpy.fourigui users community by joining the Google group. The diffpy.fourigui project welcomes your expertise and enthusiasm! + +If you see a bug or want to request a feature, please `report it as an issue `_ and/or `submit a fix as a PR `_. You can also post it to the `Diffpy user group `_. -Feel free to fork the project and contribute. To install diffpy.structure -in a development mode, where the sources are directly used by Python -rather than copied to a system directory, use :: +Feel free to fork the project and contribute. To install diffpy.fourigui +in a development mode, with its sources being directly used by Python +rather than copied to a package directory, use the following in the root +directory :: - python setup.py develop --user + pip install -e . +To ensure code quality and to prevent accidental commits into the default branch, please set up the use of our pre-commit +hooks. -ACKNOWLEDGEMENT ------------------------------------------------------------------------- +1. Install pre-commit in your working environment by running ``conda install pre-commit``. -{{cookiecutter.acknowledgements}} +2. Initialize pre-commit (one time only) ``pre-commit install``. +Thereafter your code will be linted by black and isort and checked against flake8 before you can commit. +If it fails by black or isort, just rerun and it should pass (black and isort will modify the files so should +pass after they are modified). If the flake8 test fails please see the error messages and fix them manually before +trying to commit again. -CONTACTS ------------------------------------------------------------------------- +Improvements and fixes are always appreciated. -For more information on diffpy.structure please visit the project web-page +Before contribuing, please read our `Code of Conduct `_. -http://www.diffpy.org/ +Contact +------- -or email Prof. Simon Billinge at sb2896@columbia.edu. +For more information on diffpy.fourigui please visit the project `web-page `_ or email Prof. Simon Billinge at sb2896@columbia.edu.