|
|
|
[[_TOC_]]
|
|
|
|
|
|
|
|
# Release details
|
|
|
|
|
|
|
|
This release cherry-picks the relevant commits from https://git.ligo.org/lscsoft/pesummary/-/merge_requests/691 to the [`v0.13.3`](https://git.ligo.org/lscsoft/pesummary/-/tags/v0.13.3) tag. A diff between the `release_v0.13.4` branch and `v0.13.3` tag can be seen below. The pipeline for the `release_v0.13.4` branch can be seen [here](https://git.ligo.org/lscsoft/pesummary/-/pipelines/402015).
|
|
|
|
|
|
|
|
<details><summary>diff</summary>
|
|
|
|
|
|
|
|
```bash
|
|
|
|
diff --git a/pesummary/gw/cosmology.py b/pesummary/gw/cosmology.py
|
|
|
|
index 6b9ff7c..912fa22 100644
|
|
|
|
--- a/pesummary/gw/cosmology.py
|
|
|
|
+++ b/pesummary/gw/cosmology.py
|
|
|
|
@@ -2,13 +2,14 @@
|
|
|
|
|
|
|
|
from pesummary import conf
|
|
|
|
from astropy import cosmology as cosmo
|
|
|
|
+from astropy.cosmology import parameters
|
|
|
|
|
|
|
|
__author__ = ["Charlie Hoy <charlie.hoy@ligo.org>"]
|
|
|
|
-_available_cosmologies = list(cosmo.parameters.available) + ["Planck15_lal"]
|
|
|
|
-_available_cosmologies += [
|
|
|
|
- _cosmology + "_with_Riess2019_H0" for _cosmology in _available_cosmologies
|
|
|
|
+_astropy_cosmologies = [i.lower() for i in parameters.available]
|
|
|
|
+available_cosmologies = _astropy_cosmologies + ["planck15_lal"]
|
|
|
|
+available_cosmologies += [
|
|
|
|
+ _cosmology + "_with_riess2019_h0" for _cosmology in available_cosmologies
|
|
|
|
]
|
|
|
|
-available_cosmologies = [i.lower() for i in _available_cosmologies]
|
|
|
|
|
|
|
|
|
|
|
|
def get_cosmology(cosmology=conf.cosmology):
|
|
|
|
@@ -19,20 +20,18 @@ def get_cosmology(cosmology=conf.cosmology):
|
|
|
|
cosmology: str
|
|
|
|
name of a known cosmology
|
|
|
|
"""
|
|
|
|
- if cosmology.lower() not in [i.lower() for i in available_cosmologies]:
|
|
|
|
+ if cosmology.lower() not in available_cosmologies:
|
|
|
|
raise ValueError(
|
|
|
|
"Unrecognised cosmology {}. Available cosmologies are {}".format(
|
|
|
|
cosmology, ", ".join(available_cosmologies)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
- if cosmology.lower() in [astropy.lower() for astropy in cosmo.__dict__.keys()]:
|
|
|
|
- if cosmology in cosmo.__dict__.keys():
|
|
|
|
- return cosmo.__dict__[cosmology]
|
|
|
|
- name = [
|
|
|
|
- astropy for astropy in cosmo.__dict__.keys() if
|
|
|
|
- astropy.lower() == cosmology
|
|
|
|
+ elif cosmology.lower() in _astropy_cosmologies:
|
|
|
|
+ ind = [
|
|
|
|
+ num for num, name in enumerate(_astropy_cosmologies) if
|
|
|
|
+ name == cosmology.lower()
|
|
|
|
][0]
|
|
|
|
- return cosmo.__dict__[name]
|
|
|
|
+ return getattr(cosmo, list(parameters.available)[ind])
|
|
|
|
elif cosmology.lower() == "planck15_lal":
|
|
|
|
return Planck15_lal_cosmology()
|
|
|
|
elif "_with_riess2019_h0" in cosmology.lower():
|
|
|
|
diff --git a/pesummary/gw/inputs.py b/pesummary/gw/inputs.py
|
|
|
|
index a1332e1..3b641e3 100644
|
|
|
|
--- a/pesummary/gw/inputs.py
|
|
|
|
+++ b/pesummary/gw/inputs.py
|
|
|
|
@@ -630,8 +630,7 @@ class _GWInput(_Input):
|
|
|
|
return
|
|
|
|
try:
|
|
|
|
from pycbc import psd
|
|
|
|
-
|
|
|
|
- self._psd_default = getattr(psd, psd_default)
|
|
|
|
+ psd_default = getattr(psd, psd_default)
|
|
|
|
except ImportError:
|
|
|
|
logger.warning(
|
|
|
|
"Unable to import 'pycbc'. Unable to generate a default PSD"
|
|
|
|
diff --git a/pesummary/tests/cosmology_test.py b/pesummary/tests/cosmology_test.py
|
|
|
|
index 702e917..6061723 100644
|
|
|
|
--- a/pesummary/tests/cosmology_test.py
|
|
|
|
+++ b/pesummary/tests/cosmology_test.py
|
|
|
|
@@ -31,8 +31,9 @@ class TestCosmology(object):
|
|
|
|
"""Test that the astropy cosmology is correct
|
|
|
|
"""
|
|
|
|
from astropy import cosmology
|
|
|
|
+ from astropy.cosmology import parameters
|
|
|
|
|
|
|
|
- for cosmo in cosmology.parameters.available:
|
|
|
|
+ for cosmo in parameters.available:
|
|
|
|
_cosmo = get_cosmology(cosmology=cosmo)
|
|
|
|
astropy_cosmology = getattr(cosmology, cosmo)
|
|
|
|
for key, value in vars(_cosmo).items():
|
|
|
|
@@ -57,3 +58,19 @@ class TestCosmology(object):
|
|
|
|
assert _cosmo.H0.value == riess_H0
|
|
|
|
for key in ["Om0", "Ode0"]:
|
|
|
|
assert getattr(_base_cosmo, key) == getattr(_cosmo, key)
|
|
|
|
+
|
|
|
|
+ def test_upper_lower_case(self):
|
|
|
|
+ """Test that `get_cosmology` works with random upper and lower cases
|
|
|
|
+ """
|
|
|
|
+ from astropy import cosmology
|
|
|
|
+ for cosmo in ["Planck18", "PLANCK18", "planck18", "PlAnCk18"]:
|
|
|
|
+ _cosmo = get_cosmology(cosmology=cosmo)
|
|
|
|
+ astropy_cosmology = cosmology.Planck18
|
|
|
|
+ for key, value in vars(_cosmo).items():
|
|
|
|
+ try:
|
|
|
|
+ assert vars(astropy_cosmology)[key] == value
|
|
|
|
+ except ValueError:
|
|
|
|
+ assert all(
|
|
|
|
+ vars(astropy_cosmology)[key][_] == value[_] for _
|
|
|
|
+ in range(len(vars(astropy_cosmology)[key]))
|
|
|
|
+ )
|
|
|
|
diff --git a/pesummary/tests/pycbc.sh b/pesummary/tests/pycbc.sh
|
|
|
|
index 1949edf..f14799f 100644
|
|
|
|
--- a/pesummary/tests/pycbc.sh
|
|
|
|
+++ b/pesummary/tests/pycbc.sh
|
|
|
|
@@ -6,8 +6,9 @@ for ifo in H-H1 L-L1 V-V1; do
|
|
|
|
curl -O --silent https://dcc.ligo.org/public/0146/P1700349/001/${file}
|
|
|
|
done
|
|
|
|
|
|
|
|
-curl -O https://pycbc.org/pycbc/latest/html/_downloads/7e72d7fbb3a44c0a0ee0ca04753ef47c/single.ini
|
|
|
|
+curl -O https://raw.githubusercontent.com/gwastro/pycbc/master/examples/inference/single/single.ini
|
|
|
|
sed -i '/no-save-data/d' ./single.ini
|
|
|
|
-sed -i '/nlive = 500/a \dlogz = 1000' ./single.ini
|
|
|
|
+sed -i 's/dlogz = 0.01/dlogz = 1000/' ./single.ini
|
|
|
|
pycbc_inference --config-file single.ini --output-file ./pycbc.hdf5
|
|
|
|
summarypages --webdir ./outdir/webpage --samples ./pycbc.hdf5 --gw --path_to_samples samples
|
|
|
|
+
|
|
|
|
diff --git a/testing_requirements.txt b/testing_requirements.txt
|
|
|
|
index 2dc3945..04cfe2e 100644
|
|
|
|
--- a/testing_requirements.txt
|
|
|
|
+++ b/testing_requirements.txt
|
|
|
|
@@ -1,3 +1,3 @@
|
|
|
|
-pycbc
|
|
|
|
+pycbc>=2.0.3
|
|
|
|
cython>=0.28.5
|
|
|
|
astropy>=3.2.3,!=4.3.0
|
|
|
|
```
|
|
|
|
|
|
|
|
</details> |
|
|
|
\ No newline at end of file |