lalsuite merge requestshttps://git.ligo.org/lscsoft/lalsuite/-/merge_requests2024-03-27T16:19:37Zhttps://git.ligo.org/lscsoft/lalsuite/-/merge_requests/2268Merge release branch 202403192024-03-27T16:19:37ZDuncan Macleodduncan.macleod@ligo.orgMerge release branch 20240319### Description
This MR merges the packaging changes for the LALSuite 7.22 release back into `master`.
### API Changes and Justification
#### Backwards Compatible Changes
- [x] This change does not modify any class/function/struct/ty...### Description
This MR merges the packaging changes for the LALSuite 7.22 release back into `master`.
### API Changes and Justification
#### Backwards Compatible Changes
- [x] This change does not modify any class/function/struct/type definitions
in a public C header file or any Python class/function definitions
- [ ] This change adds new classes/functions/structs/types
to a public C header file or Python module
#### Backwards Incompatible Changes
- [ ] This change modifies an existing class/function/struct/type definition
in a public C header file or Python module
- [ ] This change removes an existing class/function/struct/type
from a public C header file or Python module
If any of the Backwards Incompatible check boxes are ticked please
provide a justification why this change is necessary and why it needs
to be done in a backwards incompatible way.
#### Review Status
cc @adam-mercerhttps://git.ligo.org/lscsoft/lalsuite/-/merge_requests/2266lal: remove conda import tests2024-03-12T12:05:23ZDuncan Macleodduncan.macleod@ligo.orglal: remove conda import tests### Description
This MR removes some redundant Python `import` tests from the `lal` conda recipe, which are incorrectly configured and causing [failures](https://git.ligo.org/lscsoft/lalsuite/-/pipelines/606580).
### API Changes and Ju...### Description
This MR removes some redundant Python `import` tests from the `lal` conda recipe, which are incorrectly configured and causing [failures](https://git.ligo.org/lscsoft/lalsuite/-/pipelines/606580).
### API Changes and Justification
#### Backwards Compatible Changes
- [x] This change does not modify any class/function/struct/type definitions
in a public C header file or any Python class/function definitions
- [ ] This change adds new classes/functions/structs/types
to a public C header file or Python module
#### Backwards Incompatible Changes
- [ ] This change modifies an existing class/function/struct/type definition
in a public C header file or Python module
- [ ] This change removes an existing class/function/struct/type
from a public C header file or Python module
If any of the Backwards Incompatible check boxes are ticked please
provide a justification why this change is necessary and why it needs
to be done in a backwards incompatible way.
#### Review Status
Please provide details on any reviews related to this change and
and the associated reviewers.Duncan Macleodduncan.macleod@ligo.orgDuncan Macleodduncan.macleod@ligo.orghttps://git.ligo.org/lscsoft/lalsuite/-/merge_requests/2265Prepare release 202403192024-03-19T11:19:36ZDuncan Macleodduncan.macleod@ligo.orgPrepare release 20240319### Description
This MR updates package versions, API versions, dependencies, and packaging to prepare a full project release.
The updated versions are as follows:
| Package | Old version | New version | API change | Notes |
| -------...### Description
This MR updates package versions, API versions, dependencies, and packaging to prepare a full project release.
The updated versions are as follows:
| Package | Old version | New version | API change | Notes |
| ------- | ----------- | ----------- | ---------- | ----- |
| lal | 7.4.1 | 7.5.0 | ~"api::minor" | |
| lalframe | 3.0.3 | 3.0.4 | ~"api::none" | |
| lalmetaio | 4.0.3 | 4.0.4 | ~"api::none" | |
| lalsimulation | 5.3.1 | 5.4.0 | ~"api::minor" | |
| lalburst | 2.0.3 | 2.0.4 | ~"api::none" | |
| lalinspiral | 4.0.4 | 5.0.0 | ~"api::major" | Removed sbank library (!1754) |
| lalinference | 4.1.5 | 4.1.6 | ~"api::none" | |
| lalpulsar | 6.0.6 | 6.1.0 | ~"api::minor" | |
| lalapps | 9.2.2 | 10.0.0 | ~"api::major" | Removed script (!2250) |
### API Changes and Justification
#### Backwards Compatible Changes
- [ ] This change does not modify any class/function/struct/type definitions
in a public C header file or any Python class/function definitions
- [ ] This change adds new classes/functions/structs/types
to a public C header file or Python module
#### Backwards Incompatible Changes
- [ ] This change modifies an existing class/function/struct/type definition
in a public C header file or Python module
- [ ] This change removes an existing class/function/struct/type
from a public C header file or Python module
If any of the Backwards Incompatible check boxes are ticked please
provide a justification why this change is necessary and why it needs
to be done in a backwards incompatible way.
#### Review Status
Please provide details on any reviews related to this change and
and the associated reviewers.Duncan Macleodduncan.macleod@ligo.orgDuncan Macleodduncan.macleod@ligo.orghttps://git.ligo.org/lscsoft/lalsuite/-/merge_requests/2263Minor fixes for lint:authors, lint:pretty code quality reports2024-03-13T19:21:22ZKarl WetteMinor fixes for lint:authors, lint:pretty code quality reports### Description
1. When `make ...` failed, the job was exiting immediately before writing the code quality report. Instead use `make ... && status=0 || status=$?` to save its exit status, write the report, and then `exit ${status}`.
2. ...### Description
1. When `make ...` failed, the job was exiting immediately before writing the code quality report. Instead use `make ... && status=0 || status=$?` to save its exit status, write the report, and then `exit ${status}`.
2. Minor edits to `common/maintainer-scripts/git_diff_to_code_quality_report` to generate more compact JSON output.
I introduced some bad changes to `lal/AUTHORS` in a96ae3c25c3bfdcff38abc6ce8b7f84134a5acd9, which generated the following on the MR page:
![MR2263](/uploads/9d8818eb335a698f30860a16c736c202/MR2263.png)
The code quality report is also available [here](https://git.ligo.org/lscsoft/lalsuite/-/pipelines/606951/codequality_report) as part of the CI pipeline. (Note that, if the code quality report has a lot of changes, the widget on the MR page struggles to list them, but the report page from the CI pipeline appears more robust.)
### API Changes and Justification
#### Backwards Compatible Changes
- [x] This change does not modify any class/function/struct/type definitions in a public C header file or any Python class/function definitions
- [ ] This change adds new classes/functions/structs/types to a public C header file or Python module
#### Backwards Incompatible Changes
- [ ] This change modifies an existing class/function/struct/type definition in a public C header file or Python module
- [ ] This change removes an existing class/function/struct/type from a public C header file or Python module
#### Review Status
@adam-mercer @duncanmmacleod to approve.Karl WetteKarl Wettehttps://git.ligo.org/lscsoft/lalsuite/-/merge_requests/2261Draft: DO NOT MERGE - testing lint:authors and lint:pretty code quality2024-03-08T08:04:17ZKarl WetteDraft: DO NOT MERGE - testing lint:authors and lint:pretty code quality### Description
Testing lint:authors and lint:pretty code quality.
### API Changes and Justification
#### Backwards Compatible Changes
- [ ] This change does not modify any class/function/struct/type definitions
in a public C h...### Description
Testing lint:authors and lint:pretty code quality.
### API Changes and Justification
#### Backwards Compatible Changes
- [ ] This change does not modify any class/function/struct/type definitions
in a public C header file or any Python class/function definitions
- [ ] This change adds new classes/functions/structs/types
to a public C header file or Python module
#### Backwards Incompatible Changes
- [ ] This change modifies an existing class/function/struct/type definition
in a public C header file or Python module
- [ ] This change removes an existing class/function/struct/type
from a public C header file or Python module
If any of the Backwards Incompatible check boxes are ticked please
provide a justification why this change is necessary and why it needs
to be done in a backwards incompatible way.
#### Review Status
Please provide details on any reviews related to this change and
and the associated reviewers.Karl WetteKarl Wettehttps://git.ligo.org/lscsoft/lalsuite/-/merge_requests/2259Code quality reports for lint:authors and lint:pretty CI jobs2024-03-08T01:09:35ZKarl WetteCode quality reports for lint:authors and lint:pretty CI jobs### Description
Uses generic `./common/maintainer-scripts/git_diff_to_code_quality_report` script to turn a Git diff into a code quality JSON file.
Closes #713.
### API Changes and Justification
#### Backwards Compatible Changes
- [...### Description
Uses generic `./common/maintainer-scripts/git_diff_to_code_quality_report` script to turn a Git diff into a code quality JSON file.
Closes #713.
### API Changes and Justification
#### Backwards Compatible Changes
- [x] This change does not modify any class/function/struct/type definitions
in a public C header file or any Python class/function definitions
- [ ] This change adds new classes/functions/structs/types
to a public C header file or Python module
#### Backwards Incompatible Changes
- [ ] This change modifies an existing class/function/struct/type definition
in a public C header file or Python module
- [ ] This change removes an existing class/function/struct/type
from a public C header file or Python module
#### Review Status
n/aKarl WetteKarl Wettehttps://git.ligo.org/lscsoft/lalsuite/-/merge_requests/2258lal*/swig/: improve memory leak checking code, pretty-formatting2024-03-06T10:09:16ZKarl Wettelal*/swig/: improve memory leak checking code, pretty-formatting### Description
Some SWIG-related updates:
* Improve memory leak checking code, needed for Python 3.12
* Suppress some GCC warnings
* Pretty-format C/Python under `lal*/swig/`, other cosmetic changes
Closes #739
### API Changes and J...### Description
Some SWIG-related updates:
* Improve memory leak checking code, needed for Python 3.12
* Suppress some GCC warnings
* Pretty-format C/Python under `lal*/swig/`, other cosmetic changes
Closes #739
### API Changes and Justification
#### Backwards Compatible Changes
- [x] This change does not modify any class/function/struct/type definitions
in a public C header file or any Python class/function definitions
- [ ] This change adds new classes/functions/structs/types
to a public C header file or Python module
#### Backwards Incompatible Changes
- [ ] This change modifies an existing class/function/struct/type definition
in a public C header file or Python module
- [ ] This change removes an existing class/function/struct/type
from a public C header file or Python module
#### Review Status
cc @duncanmmacleodKarl WetteKarl Wettehttps://git.ligo.org/lscsoft/lalsuite/-/merge_requests/2256Add Python 3.12 conda migration for LAL2024-03-06T17:20:46ZDuncan Macleodduncan.macleod@ligo.orgAdd Python 3.12 conda migration for LAL### Description
This MR adds the conda-forge Python 3.12 migration for LAL.
See the upstream conda-forge build here: <https://github.com/conda-forge/lal-feedstock/pull/96>
### API Changes and Justification
#### Backwards Compatible C...### Description
This MR adds the conda-forge Python 3.12 migration for LAL.
See the upstream conda-forge build here: <https://github.com/conda-forge/lal-feedstock/pull/96>
### API Changes and Justification
#### Backwards Compatible Changes
- [x] This change does not modify any class/function/struct/type definitions
in a public C header file or any Python class/function definitions
- [ ] This change adds new classes/functions/structs/types
to a public C header file or Python module
#### Backwards Incompatible Changes
- [ ] This change modifies an existing class/function/struct/type definition
in a public C header file or Python module
- [ ] This change removes an existing class/function/struct/type
from a public C header file or Python module
If any of the Backwards Incompatible check boxes are ticked please
provide a justification why this change is necessary and why it needs
to be done in a backwards incompatible way.
#### Review Status
Please provide details on any reviews related to this change and
and the associated reviewers.Adam MercerAdam Mercerhttps://git.ligo.org/lscsoft/lalsuite/-/merge_requests/2237lal/lib/fft/RealFFT: remove \section and \subsection to make doxygen 1.10.0 h...2024-01-18T19:36:04ZDavid Keiteldavid.keitel@ligo.orglal/lib/fft/RealFFT: remove \section and \subsection to make doxygen 1.10.0 happy### Description
Partially addresses #729. Doxygen 1.10.0 doesn't seem to like mixed use of `##`/`###` on the one hand and `\section`/`\subsection` on the other hand, like RealFFT.[c/h] do it. This patch, simply changing to all-hashes, s...### Description
Partially addresses #729. Doxygen 1.10.0 doesn't seem to like mixed use of `##`/`###` on the one hand and `\section`/`\subsection` on the other hand, like RealFFT.[c/h] do it. This patch, simply changing to all-hashes, seems to work - one loses the anchors defined in the tex-like syntax, but I couldn't find them linked to from anywhere, so I guess it's ok. On the other hand, I couldn't find any note explicitly deprecating the tex-like use, so if there's a more elegant solution @karl-wette feel free to suggest something else.
### API Changes and Justification
#### Backwards Compatible Changes
- [x] This change does not modify any class/function/struct/type definitions
in a public C header file or any Python class/function definitions
- [ ] This change adds new classes/functions/structs/types
to a public C header file or Python module
#### Backwards Incompatible Changes
- [ ] This change modifies an existing class/function/struct/type definition
in a public C header file or Python module
- [ ] This change removes an existing class/function/struct/type
from a public C header file or Python module
If any of the Backwards Incompatible check boxes are ticked please
provide a justification why this change is necessary and why it needs
to be done in a backwards incompatible way.
#### Review Status
---David Keiteldavid.keitel@ligo.orgDavid Keiteldavid.keitel@ligo.orghttps://git.ligo.org/lscsoft/lalsuite/-/merge_requests/2236#define _DETECTOR_BIT constants, ignore -Wstringop-overflow warnings2024-02-08T21:27:25ZKarl Wette#define _DETECTOR_BIT constants, ignore -Wstringop-overflow warnings### Description
- `lal/lib/tools/LALDetectors.h`: `#define` the `_DETECTOR_BIT` constants instead of using `enum`
- `enum` is always `int` (until C23/C++11) so `LAL_ET*_DETECTOR_BIT` constants overflow.
- SWIG never did parse `_DETE...### Description
- `lal/lib/tools/LALDetectors.h`: `#define` the `_DETECTOR_BIT` constants instead of using `enum`
- `enum` is always `int` (until C23/C++11) so `LAL_ET*_DETECTOR_BIT` constants overflow.
- SWIG never did parse `_DETECTOR_BIT` definition correctly; silently ignored until v4.2.0.
- Revert `lal: pin swig < 4.2.0`
- This reverts commit 148dc548ae86c5df136741b128f9b72b9867ff4e.
- Revert `lalframe: pin swig < 4.2.0`
- This reverts commit b29db69e33dce3a4b5a2ba893f91b6608a9870d1.
- Revert `lalmetaio: pin swig < 4.2.0`
- This reverts commit 12e596477d45eb384164da8b86ee4566b10b7e63.
- Revert `lalsimulation: pin swig < 4.2.0`
- This reverts commit 444e781215181ac03a126625aa83bcaf2facdebc.
- Revert `lalburst: pin swig < 4.2.0`
- This reverts commit e6bb405919197ec3480df864277e18acdcb04393.
- Revert `lalinspiral: pin swig < 4.2.0`
- This reverts commit 976e1e9c51e6f2ed24a1fb71b9d11aa33fdcb7f4.
- Revert `lalinference: pin swig < 4.2.0`
- This reverts commit 1d86b7e55ae568eafa743dbc2691c51e46945832.
- Revert `lalpulsar: pin swig < 4.2.0`
- This reverts commit 79fe5ddd76d5abaabc69f61ee05c21997632884e.
- Revert `pin swig in common conda environment setup`
- This reverts commit 1f9810a882d20e1104b94450c7031872aead059f.
- `gnuscripts/lalsuite_swig.m4`: ignore `-Wstringop-overflow` warnings in wrapper code
- SWIG wrapper code does some funky casting, which is correct, but confuses the warnings.
- `lal/lib/tools/LALDetectors.h`: assign type name to enumeration of detectors
- `lal/lib/tools/LALDetectors.h`: add inline SWIG function to compute detector DQ bits
### API Changes and Justification
#### Backwards Compatible Changes
- [ ] This change does not modify any class/function/struct/type definitions
in a public C header file or any Python class/function definitions
- [x] This change adds new classes/functions/structs/types
to a public C header file or Python module
`enum`s aren't compiled into shared libraries, so changing the `_DETECTOR_BIT` constants from an `enum` to a `#define` is not an API/ABI change. It does, however, remove those constants from the SWIG interface, so it a backward-incompatible change to the SWIGLAL API. Those constants were never guaranteed to be defined correctly, however, and hopefully no one has been using them from SWIG.
#### Backwards Incompatible Changes
- [ ] This change modifies an existing class/function/struct/type definition
in a public C header file or Python module
- [ ] This change removes an existing class/function/struct/type
from a public C header file or Python module
#### Review Status
Closes #725
Requires #728Karl WetteKarl Wettehttps://git.ligo.org/lscsoft/lalsuite/-/merge_requests/2234Pin swig < 4.2.0 in conda packages2024-01-12T21:15:11ZDuncan Macleodduncan.macleod@ligo.orgPin swig < 4.2.0 in conda packages### Description
This MR provides a work around for #725 by pinning swig to `<4.2.0a0` in all conda recipes.
### API Changes and Justification
#### Backwards Compatible Changes
- [x] This change does not modify any class/function/stru...### Description
This MR provides a work around for #725 by pinning swig to `<4.2.0a0` in all conda recipes.
### API Changes and Justification
#### Backwards Compatible Changes
- [x] This change does not modify any class/function/struct/type definitions
in a public C header file or any Python class/function definitions
- [ ] This change adds new classes/functions/structs/types
to a public C header file or Python module
#### Backwards Incompatible Changes
- [ ] This change modifies an existing class/function/struct/type definition
in a public C header file or Python module
- [ ] This change removes an existing class/function/struct/type
from a public C header file or Python module
If any of the Backwards Incompatible check boxes are ticked please
provide a justification why this change is necessary and why it needs
to be done in a backwards incompatible way.
#### Review Status
Please provide details on any reviews related to this change and
and the associated reviewers.https://git.ligo.org/lscsoft/lalsuite/-/merge_requests/2226Draft: Use RTLD_DEEPBIND when importing the LAL SWIG library2023-11-30T20:37:38ZDuncan Macleodduncan.macleod@ligo.orgDraft: Use RTLD_DEEPBIND when importing the LAL SWIG library### Description
This MR attempts to resolve widely-seen issues using the LAL SWIG bindings for a version of LAL linked against FFTW in an environment where the `libblas` implementation is linked against MKL.
In this scenario you regula...### Description
This MR attempts to resolve widely-seen issues using the LAL SWIG bindings for a version of LAL linked against FFTW in an environment where the `libblas` implementation is linked against MKL.
In this scenario you regularly see things like this:
```python
>>> import numpy
>>> import lal
>>> lal.CreateForwardREAL8FFTPlan(512, 1)
XLAL Error - XLALCreateREAL8FFTPlan (/home/conda/feedstock_root/build_artifacts/lal-split_1698222321355/work/lib/fft/RealFFT_source.c:120): Generic failure
XLAL Error - XLALCreateForwardREAL8FFTPlan (/home/conda/feedstock_root/build_artifacts/lal-split_1698222321355/work/lib/fft/RealFFT_source.c:136): Internal function call failed: Generic failure
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
RuntimeError: Internal function call failed: Generic failure
```
The issue is that, when `numpy` is imported _first_, the FFTW-related symbols from MKL are loaded into the global namespace, so when `liblal.so` is loaded it uses the MKL symbols instead of the FFTW symbols, and things fall over.
The solution is to somehow force `liblal.so` to use the symbols from the library against which it is linked, and the attached patch is the most generic and least intrusive way I have come up with so far.
Closes #300, closes #478.
### API Changes and Justification
#### Backwards Compatible Changes
- [ ] This change does not modify any class/function/struct/type definitions
in a public C header file or any Python class/function definitions
- [ ] This change adds new classes/functions/structs/types
to a public C header file or Python module
#### Backwards Incompatible Changes
- [ ] This change modifies an existing class/function/struct/type definition
in a public C header file or Python module
- [ ] This change removes an existing class/function/struct/type
from a public C header file or Python module
If any of the Backwards Incompatible check boxes are ticked please
provide a justification why this change is necessary and why it needs
to be done in a backwards incompatible way.
#### Review Status
Please provide details on any reviews related to this change and
and the associated reviewers.https://git.ligo.org/lscsoft/lalsuite/-/merge_requests/2222rebrand as LVK Algorithm Library2023-11-21T17:19:07ZAdam Mercerrebrand as LVK Algorithm Library### Description
Rebrands as the LVK Algorithm Library, see #637 for details.
### API Changes and Justification
#### Backwards Compatible Changes
- [x] This change does not modify any class/function/struct/type definitions
in a ...### Description
Rebrands as the LVK Algorithm Library, see #637 for details.
### API Changes and Justification
#### Backwards Compatible Changes
- [x] This change does not modify any class/function/struct/type definitions
in a public C header file or any Python class/function definitions
- [ ] This change adds new classes/functions/structs/types
to a public C header file or Python module
#### Backwards Incompatible Changes
- [ ] This change modifies an existing class/function/struct/type definition
in a public C header file or Python module
- [ ] This change removes an existing class/function/struct/type
from a public C header file or Python module
If any of the Backwards Incompatible check boxes are ticked please
provide a justification why this change is necessary and why it needs
to be done in a backwards incompatible way.
#### Review Status
Please provide details on any reviews related to this change and
and the associated reviewers.Adam MercerAdam Mercerhttps://git.ligo.org/lscsoft/lalsuite/-/merge_requests/2221Pin conda builds to use mkl 20222023-11-14T14:24:37ZDuncan Macleodduncan.macleod@ligo.orgPin conda builds to use mkl 2022### Description
This MR attempts to fix the currently failing `lal:conda:mkl` build by pinning to mkl 2022.
See https://github.com/conda-forge/lal-feedstock/pull/93 for the failing mkl 2023 migration.
### API Changes and Justification...### Description
This MR attempts to fix the currently failing `lal:conda:mkl` build by pinning to mkl 2022.
See https://github.com/conda-forge/lal-feedstock/pull/93 for the failing mkl 2023 migration.
### API Changes and Justification
#### Backwards Compatible Changes
- [x] This change does not modify any class/function/struct/type definitions
in a public C header file or any Python class/function definitions
- [ ] This change adds new classes/functions/structs/types
to a public C header file or Python module
#### Backwards Incompatible Changes
- [ ] This change modifies an existing class/function/struct/type definition
in a public C header file or Python module
- [ ] This change removes an existing class/function/struct/type
from a public C header file or Python module
If any of the Backwards Incompatible check boxes are ticked please
provide a justification why this change is necessary and why it needs
to be done in a backwards incompatible way.
#### Review Status
Please provide details on any reviews related to this change and
and the associated reviewers.https://git.ligo.org/lscsoft/lalsuite/-/merge_requests/2220fix advice on turning off swig_redirect_standard_output_error2023-11-14T16:14:20ZDavid Keiteldavid.keitel@ligo.orgfix advice on turning off swig_redirect_standard_output_error### Description
@karl-wette as reported by @jonathan.thompson [on the chat](https://chat.ligo.org/ligo/pl/d51irhs1k3ddf8xzcfrhrnkoic), the printed advice from !2202 seems to be the wrong way around.
### API Changes and Justification
#...### Description
@karl-wette as reported by @jonathan.thompson [on the chat](https://chat.ligo.org/ligo/pl/d51irhs1k3ddf8xzcfrhrnkoic), the printed advice from !2202 seems to be the wrong way around.
### API Changes and Justification
#### Backwards Compatible Changes
- [x] This change does not modify any class/function/struct/type definitions
in a public C header file or any Python class/function definitions
- [ ] This change adds new classes/functions/structs/types
to a public C header file or Python module
#### Backwards Incompatible Changes
- [ ] This change modifies an existing class/function/struct/type definition
in a public C header file or Python module
- [ ] This change removes an existing class/function/struct/type
from a public C header file or Python module
If any of the Backwards Incompatible check boxes are ticked please
provide a justification why this change is necessary and why it needs
to be done in a backwards incompatible way.
#### Review Status
---https://git.ligo.org/lscsoft/lalsuite/-/merge_requests/2215Merge release branch2023-10-21T18:45:31ZAdam MercerMerge release branch### Description
More updates from release branch due to new versions to address tarball generation issues.
### API Changes and Justification
#### Backwards Compatible Changes
- [x] This change does not modify any class/function/struc...### Description
More updates from release branch due to new versions to address tarball generation issues.
### API Changes and Justification
#### Backwards Compatible Changes
- [x] This change does not modify any class/function/struct/type definitions
in a public C header file or any Python class/function definitions
- [ ] This change adds new classes/functions/structs/types
to a public C header file or Python module
#### Backwards Incompatible Changes
- [ ] This change modifies an existing class/function/struct/type definition
in a public C header file or Python module
- [ ] This change removes an existing class/function/struct/type
from a public C header file or Python module
If any of the Backwards Incompatible check boxes are ticked please
provide a justification why this change is necessary and why it needs
to be done in a backwards incompatible way.
#### Review Status
Please provide details on any reviews related to this change and
and the associated reviewers.Adam MercerAdam Mercerhttps://git.ligo.org/lscsoft/lalsuite/-/merge_requests/2214Merge release branch2023-10-20T02:09:52ZAdam MercerMerge release branch### Description
Merges packaging update from the release branch back to `master`.
### API Changes and Justification
#### Backwards Compatible Changes
- [x] This change does not modify any class/function/struct/type definitions
...### Description
Merges packaging update from the release branch back to `master`.
### API Changes and Justification
#### Backwards Compatible Changes
- [x] This change does not modify any class/function/struct/type definitions
in a public C header file or any Python class/function definitions
- [ ] This change adds new classes/functions/structs/types
to a public C header file or Python module
#### Backwards Incompatible Changes
- [ ] This change modifies an existing class/function/struct/type definition
in a public C header file or Python module
- [ ] This change removes an existing class/function/struct/type
from a public C header file or Python module
If any of the Backwards Incompatible check boxes are ticked please
provide a justification why this change is necessary and why it needs
to be done in a backwards incompatible way.
#### Review Status
Please provide details on any reviews related to this change and
and the associated reviewers.Adam MercerAdam Mercerhttps://git.ligo.org/lscsoft/lalsuite/-/merge_requests/2213Build system rules for pretty-formatting C and Python code2023-12-07T05:30:52ZKarl WetteBuild system rules for pretty-formatting C and Python code### Description
This MR adds build system rules for pretty-formatting C and Python code. _No code is reformatted by default. Pretty-formatting is entirely opt-in, either on a per-file, per-directory, or per-LALSuite library basis._
Pre...### Description
This MR adds build system rules for pretty-formatting C and Python code. _No code is reformatted by default. Pretty-formatting is entirely opt-in, either on a per-file, per-directory, or per-LALSuite library basis._
Pretty-formatting only works in a Git checkout, and only processes files that have already been committed to Git. Hopefully that will mean that a user can always roll back to an un-pretty-formatted version of the code, in case the pretty-formatting causes problems during development.
C code is pretty-formatted using [Artistic Style](https://astyle.sourceforge.net/). This is a more modern C/C++ formatter than `indent`. I've often used it to tidy up my own code, and it seems reliable. It's available for [RPMs](http://rpmfind.net/linux/rpm2html/search.php?query=astyle), [Debian](https://packages.debian.org/search?keywords=astyle), [Ubuntu](https://packages.ubuntu.com/search?keywords=astyle), [Homebrew](https://formulae.brew.sh/formula/astyle), [MacPorts](https://ports.macports.org/port/astyle/), etc. It supports lots of different options for formatting C/C++ in different styles.
* Artistic Style options are given either in
* A per source config file, e.g. `lalpulsar/lib/.LatticeTiling.pretty.astylerc` will apply to `lalpulsar/lib/LatticeTiling.[ch]`
* A per directory config file, e.g. `lalpulsar/bin/Weave/.pretty.astylerc` will apply to everything in `lalpulsar/bin/Weave/`
* A library top-level config file, e.g. `lalpulsar/.pretty.astylerc`, will apply to everything in LALPulsar
Python code is pretty-formatted using [Black](https://black.readthedocs.io/en/stable/).
* Black is enabled either
* Per file, e.g. the presence of a file `lalpulsar/python/lalpulsar/.simulateCW.pretty.black` will reformat `lalpulsar/python/lalpulsar/simulateCW.py`
* Per directory, e.g. the presence of a file `lalpulsar/python/lalpulsar/.pretty.black` will reformat everything in `lalpulsar/python/lalpulsar`
* Per library, e.g. the presence of a file `lalpulsar/.pretty.black` will reformat everything in LALPulsar
Pretty-formatting is performed by running `make pretty`. A new CI job `lint:pretty` runs `make pretty` to check that code has been pretty-formatted before merging.
### API Changes and Justification
#### Backwards Compatible Changes
- [x] This change does not modify any class/function/struct/type definitions
in a public C header file or any Python class/function definitions
- [ ] This change adds new classes/functions/structs/types
to a public C header file or Python module
#### Backwards Incompatible Changes
- [ ] This change modifies an existing class/function/struct/type definition
in a public C header file or Python module
- [ ] This change removes an existing class/function/struct/type
from a public C header file or Python module
If any of the Backwards Incompatible check boxes are ticked please
provide a justification why this change is necessary and why it needs
to be done in a backwards incompatible way.
#### Review Status
Please provide details on any reviews related to this change and
and the associated reviewers.Karl WetteKarl Wettehttps://git.ligo.org/lscsoft/lalsuite/-/merge_requests/2202lal/python/lal/__init__.py.in: warn on performance penalty of SWIGLAL stdio r...2024-01-16T16:58:51ZKarl Wettelal/python/lal/__init__.py.in: warn on performance penalty of SWIGLAL stdio redirection### Description
As discovered by @matthew-pitkin in #709 the SWIGLAL redirection of standard output/error enabled by default in IPython can incur a significant performance penalty. It is desirable to continue to enable the redirection b...### Description
As discovered by @matthew-pitkin in #709 the SWIGLAL redirection of standard output/error enabled by default in IPython can incur a significant performance penalty. It is desirable to continue to enable the redirection by default, to ensure error messages aren't lost when calling LAL code from Jupyter notebooks, and under the assumption that most people aren't replying on peak performance for interactive use with Jupyter notebooks. That said, this should probably come with a warning in case the performance impact is important for some use cases.
This MR adds a warning in `lal/python/lal/__init__.py.in` if SWIGLAL is used from IPython. The warning explains the possible performance consequences of the redirection; how to disable it locally (using a context manager) or globally, and the consequences of doing so; and how to disable the warning itself if people find it annoying. (There's also a minor build system fix to `gnuscripts/lalsuite_python.am`.)
Example usage:
```
Python 3.8.10 (default, May 26 2023, 14:05:08)
Type 'copyright', 'credits' or 'license' for more information
IPython 7.13.0 -- An enhanced Interactive Python. Type '?' for help.
In [1]: import lal
<ipython-input-1-d291d32a6bcc>:1: UserWarning: Wswiglal-redir-stdio:
SWIGLAL standard output/error redirection is enabled in IPython.
This may lead to performance penalties. To disable locally, use:
with lal.no_swig_redirect_standard_output_error():
...
To disable globally, use:
lal.swig_redirect_standard_output_error(True)
Note however that this will likely lead to error messages from
LAL functions being either misdirected or lost when called from
Jupyter notebooks.
To suppress this warning, use:
import warnings
warnings.filterwarnings("ignore", "Wswiglal-redir-stdio")
import lal
import lal
In [2]: seconds = 1357377318
In [3]: nanoseconds = 0
In [4]: %timeit lal.LIGOTimeGPS(seconds, nanoseconds)
12.4 ms ± 3.78 ms per loop (mean ± std. dev. of 7 runs, 100 loops each)
In [5]: with lal.no_swig_redirect_standard_output_error():
...: %timeit lal.LIGOTimeGPS(seconds, nanoseconds)
...:
583 ns ± 9.93 ns per loop (mean ± std. dev. of 7 runs, 1000000 loops each)
In [6]:
```
```
Python 3.8.10 (default, May 26 2023, 14:05:08)
Type 'copyright', 'credits' or 'license' for more information
IPython 7.13.0 -- An enhanced Interactive Python. Type '?' for help.
In [1]: import warnings
...: warnings.filterwarnings("ignore", "Wswiglal-redir-stdio")
...: import lal
...:
In [2]:
```
### API Changes and Justification
#### Backwards Compatible Changes
- [x] This change does not modify any class/function/struct/type definitions
in a public C header file or any Python class/function definitions
- [ ] This change adds new classes/functions/structs/types
to a public C header file or Python module
#### Backwards Incompatible Changes
- [ ] This change modifies an existing class/function/struct/type definition
in a public C header file or Python module
- [ ] This change removes an existing class/function/struct/type
from a public C header file or Python module
If any of the Backwards Incompatible check boxes are ticked please
provide a justification why this change is necessary and why it needs
to be done in a backwards incompatible way.
#### Review Status
cc @adam-mercer for the upcoming release.Karl WetteKarl Wettehttps://git.ligo.org/lscsoft/lalsuite/-/merge_requests/2171fix the truncation error in LIGOTimeGPS set from XLALGPSSetREAL82023-07-04T16:14:58ZWanting Niufix the truncation error in LIGOTimeGPS set from XLALGPSSetREAL8### Description
A "bug" fix explained in this issue: https://git.ligo.org/lscsoft/lalsuite/-/issues/683. In the existing calculation of gpsNanoSecond in `XLALGPSSetREAL8` (in `lal/lib/date/XLALTime.c`), there is **a truncation error cau...### Description
A "bug" fix explained in this issue: https://git.ligo.org/lscsoft/lalsuite/-/issues/683. In the existing calculation of gpsNanoSecond in `XLALGPSSetREAL8` (in `lal/lib/date/XLALTime.c`), there is **a truncation error caused by subtracting a INT4 variable from a REAL8 variable** in this line: https://git.ligo.org/lscsoft/lalsuite/-/blob/master/lal/lib/date/XLALTime.c#L76.
For example, if we input a REAL8 `t=1234567890.1234` into `XLALGPSSetREAL8`, instead of outputting the INT4 `gpsSecond=1234567890` and INT4 `gpsNanoSecond=123400000`, we will get the outputted nanosecond part to be `gpsNanoSecond=123399973`. This difference is an unnecessary inaccuracy produced by a truncation error in C. We should fix this issue to maintain the precision of LIGOTimeGPS.
### API Changes and Justification
#### Backwards Compatible Changes
- [x] This change does not modify any class/function/struct/type definitions
in a public C header file or any Python class/function definitions
- [ ] This change adds new classes/functions/structs/types
to a public C header file or Python module
#### Backwards Incompatible Changes
- [ ] This change modifies an existing class/function/struct/type definition
in a public C header file or Python module
- [ ] This change removes an existing class/function/struct/type
from a public C header file or Python module
If any of the Backwards Incompatible check boxes are ticked please
provide a justification why this change is necessary and why it needs
to be done in a backwards incompatible way.
#### Review Status
It would be great if @jolien-creighton or @kipp.cannon can have some review on it. Here is some local test I did:
before the change:
```
>>> t = 1234567890.10001
>>> time = lal.LIGOTimeGPS(t)
>>> time.gpsNanoSeconds
100009918
>>> t = 1234567890.1234
>>> time = lal.LIGOTimeGPS(t)
>>> time.gpsNanoSeconds
123399973
>>> t = 1234567890.10001
>>> time = lal.LIGOTimeGPS(t)
>>> time.gpsNanoSeconds
100009918
>>> t = 1234567890.123456
>>> time = lal.LIGOTimeGPS(t)
>>> time.gpsNanoSeconds
123456001
>>> t = 1234567890.12345
>>> time = lal.LIGOTimeGPS(t)
>>> time.gpsNanoSeconds
123450041
```
after the change:
```
>>> t = 1234567890.10001
>>> time = lal.LIGOTimeGPS(t)
>>> time.gpsNanoSeconds
100010000
>>> t = 1234567890.1234
>>> time = lal.LIGOTimeGPS(t)
>>> time.gpsNanoSeconds
123400000
>>> t = 1234567890.10001
>>> time = lal.LIGOTimeGPS(t)
>>> time.gpsNanoSeconds
100010000
>>> t = 1234567890.123456
>>> time = lal.LIGOTimeGPS(t)
>>> time.gpsNanoSeconds
123456000
>>> t = 1234567890.12345
>>> time = lal.LIGOTimeGPS(t)
>>> time.gpsNanoSeconds
123450000
```