From 34a82af51f6f2adb66c91a51751eaec8fc7db49d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 25 Jul 2024 10:58:56 +0000 Subject: [PATCH 1/5] Bump torch from 1.4.0 to 2.2.0 Bumps [torch](https://github.com/pytorch/pytorch) from 1.4.0 to 2.2.0. - [Release notes](https://github.com/pytorch/pytorch/releases) - [Changelog](https://github.com/pytorch/pytorch/blob/main/RELEASE.md) - [Commits](https://github.com/pytorch/pytorch/compare/v1.4.0...v2.2.0) --- updated-dependencies: - dependency-name: torch dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 204f015..cb725eb 100644 --- a/requirements.txt +++ b/requirements.txt @@ -10,5 +10,5 @@ george nestle elk-waveform gpytorch==1.0.1 -torch==1.4.0 +torch==2.2.0 torchvision==0.5.0 From fca68b73aad912c53287ed10e95392676637255b Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Tue, 20 Aug 2024 14:12:41 +0100 Subject: [PATCH 2/5] Update torch from 2.2.0 to 2.4.0 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index cb725eb..d7acace 100644 --- a/requirements.txt +++ b/requirements.txt @@ -10,5 +10,5 @@ george nestle elk-waveform gpytorch==1.0.1 -torch==2.2.0 +torch==2.4.0 torchvision==0.5.0 From 1fab73dca034061795a15c2a7a2235bdae1a24c9 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Tue, 20 Aug 2024 14:12:47 +0100 Subject: [PATCH 3/5] Pin numpydoc to latest version 1.8.0 --- requirements_dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements_dev.txt b/requirements_dev.txt index 1ace67f..19b5387 100644 --- a/requirements_dev.txt +++ b/requirements_dev.txt @@ -9,6 +9,6 @@ george nestle sphinx -numpydoc +numpydoc==1.8.0 git+https://github.com/transientlunatic/sphinx-daniel-theme.git nbsphinx From c45dfd48069abe087a1b4ab4c3008f98e381275b Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Tue, 20 Aug 2024 14:12:48 +0100 Subject: [PATCH 4/5] Pin nbsphinx to latest version 0.9.5 --- requirements_dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements_dev.txt b/requirements_dev.txt index 1ace67f..6a0614e 100644 --- a/requirements_dev.txt +++ b/requirements_dev.txt @@ -11,4 +11,4 @@ nestle sphinx numpydoc git+https://github.com/transientlunatic/sphinx-daniel-theme.git -nbsphinx +nbsphinx==0.9.5 From 55b32379df0dd94da9e8fdd6b7ba13b36692906c Mon Sep 17 00:00:00 2001 From: Daniel Williams Date: Mon, 26 Aug 2024 12:52:29 +0100 Subject: [PATCH 5/5] Update handling of mass ratio --- heron/likelihood.py | 2 +- heron/models/__init__.py | 22 ++++++++++++++-------- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/heron/likelihood.py b/heron/likelihood.py index 2b304d8..3c8fd05 100644 --- a/heron/likelihood.py +++ b/heron/likelihood.py @@ -108,7 +108,7 @@ def __call__(self, parameters): self.logger.info(parameters) keys = set(parameters.keys()) - extrinsic = {"phase", "psi", "ra", "dec", "theta_jn"} + extrinsic = {"phase", "psi", "ra", "dec", "theta_jn", "gpstime", "geocent_time"} conversions = {"mass_ratio", "total_mass", "luminosity_distance"} bad_keys = keys - set(self.waveform._args.keys()) - extrinsic - conversions if len(bad_keys) > 0: diff --git a/heron/models/__init__.py b/heron/models/__init__.py index f3ba0fd..c311280 100644 --- a/heron/models/__init__.py +++ b/heron/models/__init__.py @@ -26,16 +26,22 @@ def _convert_luminosity_distance(self, args): return args def _convert_mass_ratio_total_mass(self, args): - - args["m1"] = (args["total_mass"] / (1 + args["mass_ratio"])).to_value( - u.kilogram - ) - args["m2"] = (args["total_mass"] / (1 + 1 / args["mass_ratio"])).to_value( - u.kilogram - ) + args["m1"] = (args["total_mass"] / (1 + args["mass_ratio"])) + args["m2"] = (args["total_mass"] / (1 + (1 / args["mass_ratio"]))) + # Do these have units? + # If not then we can skip some relatively expensive operations and apply a heuristic. + if isinstance(args["m1"], u.Quantity): + args["m1"] = args["m1"].to_value(u.kilogram) + args["m2"] = args["m2"].to_value(u.kilogram) + if (not isinstance(args["m1"], u.Quantity)) and (args["m1"] < 1000): + # This appears to be in solar masses + args["m1"] *= MSUN_SI + if (not isinstance(args["m2"], u.Quantity)) and (args["m2"] < 1000): + # This appears to be in solar masses + args["m2"] *= MSUN_SI + args.pop("total_mass") args.pop("mass_ratio") - return args