Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/release_checklist.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ assignees: ""
- [ ] Grammar and writing quality are checked (no typos).
- [ ] `FALLBACK_VERSION` in `site_scons/fallback_version.py` is updated to `<version-number>.post0`. Without this, the SCons build fails after tagging.
- [ ] `scons test` passes locally with the latest conda-forge compilers and dependencies.
- [ ] Dispatch matrix testing to test the release on all systems. If you do not have permission to run this workflow, tag the maintainer and say `@maintainer, please dispatch matrix testing workflow`. Matrix testing also runs automatically on the tag and blocks the release if it fails.
- [ ] Dispatch matrix testing to test the release on all systems. If you do not have permission to run this workflow, tag the maintainer and say `@maintainer, please dispatch matrix testing workflow`. Matrix testing also runs automatically after a GitHub release is published, but it does not block the release, so check that it passes.

Please tag the maintainer (e.g., @username) in the comment here when you are ready for the GitHub release. Include any additional comments necessary, such as version information and details about the pre-release here:

Expand Down
32 changes: 32 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,38 @@ Release notes

.. current developments

1.4.1
=====

Released 2025-06-25. Notable differences from version 1.4.0.

**Added:**

* ``qbroad_seperable`` attribute to ``JeongPeakWidth`` for a Q-dependent
peak broadening term, see https://doi.org/10.1107/S0108767391011327.
* Build scripts for Windows.
* GitHub release with the source tarball SHA256 created automatically
after a tag push.

**Changed:**

* Require libobjcryst 2017.2.1 or later.
* Add the conda environment include and library paths to the build when
``CONDA_PREFIX`` is set.
* Do not create ``OverlapCalculator`` self-neighborhoods at sites excluded
by the pair mask.

**Removed:**

* Runtime check for the ObjCryst inversion center bug, which is fixed in
libobjcryst 2017.2.1.

**Fixed:**

* ``OverlapCalculator`` now respects its ``rmin`` value.
* Build with ``REAL=double`` to match the floating-point type of libobjcryst.
* Read the installation prefix from the ``PREFIX`` environment variable.

1.4.0
=====

Expand Down
92 changes: 28 additions & 64 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,14 @@

|Forge| |PR|

|CI| |Tracking|
|CI| |Codecov| |Tracking|

.. |CI| image:: https://github.com/diffpy/libdiffpy/actions/workflows/matrix-and-codecov.yml/badge.svg
:target: https://github.com/diffpy/libdiffpy/actions/workflows/matrix-and-codecov.yml

.. |Codecov| image:: https://codecov.io/gh/diffpy/libdiffpy/branch/main/graph/badge.svg
:target: https://codecov.io/gh/diffpy/libdiffpy

.. |Forge| image:: https://img.shields.io/conda/vn/conda-forge/libdiffpy
:target: https://anaconda.org/conda-forge/libdiffpy

Expand Down Expand Up @@ -76,74 +79,30 @@ The following creates and activates a new environment named ``libdiffpy_env`` ::
conda create -n libdiffpy_env libdiffpy
conda activate libdiffpy_env

When compiling with the conda version of libdiffpy it is essential to
specify the header path, library path and runtime path of the active conda
environment. To verify the installation, compile and run the included
test code `examples/testlib.cpp <examples/testlib.cpp>`_ ::
To verify the installation, compile and run the included test code
`examples/testlib.cpp <examples/testlib.cpp>`_ ::

cd examples
c++ testlib.cpp -I$CONDA_PREFIX/include -L$CONDA_PREFIX/lib -Wl,-rpath,$CONDA_PREFIX/lib -ldiffpy
./a.out

Note the conda package for libdiffpy is built with C++ compilers
provided by conda-forge. This may cause incompatibility with system C++.
The conda package for libdiffpy is built with C++ compilers provided by
conda-forge, which may be incompatible with the system C++ compiler.
In such case please use the conda-forge C++ compiler to link with libdiffpy.

Requirements
^^^^^^^^^^^^

To build libdiffpy from sources, a C++ compiler and the following software are required:

* ``scons`` - software constructions tool (1.0 or later)
* ``libboost-dev`` - Boost C++ libraries development files (1.56 or later)
* ``GSL`` - GNU Scientific Library for C

Recommended software:

* ``libobjcryst`` - C++ library for free objects for crystallography,
https://github.com/diffpy/libobjcryst
* ``cxxtest`` - CxxTest Unit Testing Framework, http://cxxtest.com

The required software is commonly available in the system package manager.
For example, on Ubuntu Linux the required software can be installed using ::

sudo apt-get install build-essential scons libboost-dev libgsl0-dev

Alternatively, all of the above can be installed into a conda environment from
the ``requirements`` folder ::
If you prefer to install from sources, obtain the source archive from
`GitHub <https://github.com/diffpy/libdiffpy/>`_ and ``cd`` into your
``libdiffpy`` directory. Create a conda environment with the build
dependencies listed in the ``requirements`` folder ::

conda create -n libdiffpy_env --file requirements/build.txt --file requirements/conda.txt --file requirements/tests.txt
conda activate libdiffpy_env

Installation from sources
^^^^^^^^^^^^^^^^^^^^^^^^^

Use sources from the git repository or extract the latest source
bundle from https://github.com/diffpy/libdiffpy/releases/latest. ::
Then build and install libdiffpy into the active conda environment ::

tar xzf libdiffpy-VERSION.tar.gz
cd libdiffpy-VERSION
scons -j4 install

To build and install the libdiffpy library use ::

sudo scons -j4 install

This installs libdiffpy for all users under the ``/usr/local`` directory.
If administrator (root) access is not available, see the output from
``scons --help`` for options to install to a user-writable location.

To verify the libdiffpy installation, compile and run the included
test code `examples/testlib.cpp <examples/testlib.cpp>`_ ::

cd examples
c++ testlib.cpp -ldiffpy
./a.out

If compilation fails because of missing header files or missing libdiffpy
library, adjust the ``CPATH`` and ``LIBRARY_PATH`` environment variables or
use the ``-I`` or ``-L`` compiler options. If the shared library libdiffpy
is unavailable at runtime, add a ``-Wl,-rpath,SomePath`` option to the
c++ command or adjust the ``LD_LIBRARY_PATH`` environment variable.
See the output from ``scons --help`` for the available build targets and options.

Getting Started
---------------
Expand All @@ -157,17 +116,21 @@ If you see a bug or want to request a feature, please `report it as an issue <ht

Feel free to fork the project and contribute. When developing it is
preferable to compile with the ``build=develop`` option, which compiles the
library with debug information and C-assertions checks ::
library without optimizations and with C-assertions checks ::

scons -j4 build=develop

The library integrity can be verified by executing the unit tests ::

scons -j4 test

The build script checks for a presence of ``sconsvars.py`` file, which
can be used to permanently set the ``build`` variable. The SCons
construction environment can be further customized in a ``sconscript.local``
script. The library integrity can be verified by executing unit tests with
``scons test`` (requires the CxxTest framework).
script.

See also the `instructions for compiling and modifying source code in development mode <docs/development_instructions.md>`_.
See also the `development guide <docs/source/development.rst>`_ for build variants, running a subset of
the unit tests, coverage analysis and testing changes with diffpy.srreal.

To ensure code quality and to prevent accidental commits into the default branch, please set up the use of our pre-commit
hooks.
Expand All @@ -176,10 +139,11 @@ hooks.

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.
Thereafter C++ sources will be formatted by clang-format, Python build scripts will be linted by black and
isort and checked against flake8, and spelling will be checked by codespell before you can commit.
If it fails by clang-format, black or isort, just rerun and it should pass (these hooks modify the files so
should pass after they are modified). If the flake8 or codespell checks fail please see the error messages and
fix them manually before trying to commit again.

Improvements and fixes are always appreciated.

Expand Down
Loading
Loading