From 969ea2f746f9ed73da1b0ffaf8bea4838978e0b8 Mon Sep 17 00:00:00 2001 From: Sahil Jhawar Date: Fri, 8 Sep 2023 21:43:33 +0200 Subject: [PATCH 1/5] pinning GRB parameters --- nmma/tests/data/constTrPi2018.prior | 16 ++++++++++++++++ nmma/tests/injections.py | 4 +++- 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 nmma/tests/data/constTrPi2018.prior diff --git a/nmma/tests/data/constTrPi2018.prior b/nmma/tests/data/constTrPi2018.prior new file mode 100644 index 00000000..66792641 --- /dev/null +++ b/nmma/tests/data/constTrPi2018.prior @@ -0,0 +1,16 @@ +luminosity_distance = 6942.0 +timeshift = 0 +inclination_EM = 0.7 +log10_E0 = 50 +thetaCore = 0.7 +thetaWing = 0.7 +log10_n0 = 10 +p = 7 +log10_epsilon_e = -9 +log10_epsilon_B = -3 +ksiN=1.0 +L0=0.0 +dL = 3.09e19 +b = 6 +q = 0.0 +ts = 0.0 diff --git a/nmma/tests/injections.py b/nmma/tests/injections.py index 956fdff2..93b5918e 100644 --- a/nmma/tests/injections.py +++ b/nmma/tests/injections.py @@ -59,6 +59,8 @@ def create_injection_from_command_line(model_name): if model_name == "nugent-hyper": prior_path = os.path.join( priorDir, "sncosmo-generic" + ".prior") + elif model_name == "TrPi2018": + prior_path = os.path.join( dataDir, "constTrPi2018" + ".prior") #pinning the parameter svalues in the prior file else: prior_path = os.path.join( priorDir, model_name + ".prior") assert os.path.exists(prior_path), "prior file does not exist" @@ -292,7 +294,7 @@ def test_injections(): "salt2": SupernovaLightCurveModel, "Me2017": SimpleKilonovaLightCurveModel, "Piro2021": ShockCoolingLightCurveModel, - # "TrPi2018": GRBLightCurveModel, + "TrPi2018": GRBLightCurveModel, "Ka2017": SVDLightCurveModel, } for model_name, model_lightcurve_function in lightcurve_models.items(): From 7cd914cfe9278440490413b00f4a380d9203ebed Mon Sep 17 00:00:00 2001 From: sahiljhawar <55475299+sahiljhawar@users.noreply.github.com> Date: Fri, 8 Sep 2023 21:52:35 +0200 Subject: [PATCH 2/5] Update injections.py Changed to TrPi2018_pinned_parameters --- nmma/tests/injections.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nmma/tests/injections.py b/nmma/tests/injections.py index 93b5918e..d7057a50 100644 --- a/nmma/tests/injections.py +++ b/nmma/tests/injections.py @@ -60,7 +60,7 @@ def create_injection_from_command_line(model_name): if model_name == "nugent-hyper": prior_path = os.path.join( priorDir, "sncosmo-generic" + ".prior") elif model_name == "TrPi2018": - prior_path = os.path.join( dataDir, "constTrPi2018" + ".prior") #pinning the parameter svalues in the prior file + prior_path = os.path.join( dataDir, "TrPi2018_pinned_parameters" + ".prior") #pinning the parameter svalues in the prior file else: prior_path = os.path.join( priorDir, model_name + ".prior") assert os.path.exists(prior_path), "prior file does not exist" @@ -298,4 +298,4 @@ def test_injections(): "Ka2017": SVDLightCurveModel, } for model_name, model_lightcurve_function in lightcurve_models.items(): - lightcurveInjectionTest(model_name, model_lightcurve_function) \ No newline at end of file + lightcurveInjectionTest(model_name, model_lightcurve_function) From e77dd637ed82bc2e6360fd5f17f0025e52e5e9ae Mon Sep 17 00:00:00 2001 From: sahiljhawar <55475299+sahiljhawar@users.noreply.github.com> Date: Fri, 8 Sep 2023 21:52:50 +0200 Subject: [PATCH 3/5] Rename constTrPi2018.prior to TrPi2018_pinned_parametersprior --- .../data/{constTrPi2018.prior => TrPi2018_pinned_parametersprior} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename nmma/tests/data/{constTrPi2018.prior => TrPi2018_pinned_parametersprior} (100%) diff --git a/nmma/tests/data/constTrPi2018.prior b/nmma/tests/data/TrPi2018_pinned_parametersprior similarity index 100% rename from nmma/tests/data/constTrPi2018.prior rename to nmma/tests/data/TrPi2018_pinned_parametersprior From 6b2338d41b8c930705e69c297c550b56a3dca7a5 Mon Sep 17 00:00:00 2001 From: sahiljhawar <55475299+sahiljhawar@users.noreply.github.com> Date: Fri, 8 Sep 2023 22:04:02 +0200 Subject: [PATCH 4/5] Rename TrPi2018_pinned_parametersprior to TrPi2018_pinned_parameters.prior --- ...18_pinned_parametersprior => TrPi2018_pinned_parameters.prior} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename nmma/tests/data/{TrPi2018_pinned_parametersprior => TrPi2018_pinned_parameters.prior} (100%) diff --git a/nmma/tests/data/TrPi2018_pinned_parametersprior b/nmma/tests/data/TrPi2018_pinned_parameters.prior similarity index 100% rename from nmma/tests/data/TrPi2018_pinned_parametersprior rename to nmma/tests/data/TrPi2018_pinned_parameters.prior From f9ffd2e46dc5f0db2466be2f2c9d56b253045215 Mon Sep 17 00:00:00 2001 From: Sahil Jhawar Date: Fri, 8 Sep 2023 22:04:49 +0200 Subject: [PATCH 5/5] same cache for docs and unittest --- .github/workflows/deploy-github-pages.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/deploy-github-pages.yml b/.github/workflows/deploy-github-pages.yml index c1b95b61..3b77c0ef 100644 --- a/.github/workflows/deploy-github-pages.yml +++ b/.github/workflows/deploy-github-pages.yml @@ -14,10 +14,10 @@ jobs: python-version: [3.9] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: mpi4py/setup-mpi@v1 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v3 with: python-version: ${{ matrix.python-version }} - name: Get pip cache dir @@ -26,12 +26,12 @@ jobs: python -m pip install --upgrade pip setuptools wheel echo "::set-output name=dir::$(pip cache dir)" - name: pip cache - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: ${{ steps.pip-cache.outputs.dir }} - key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py', '**/requirements.txt') }} + key: ${{ runner.os }}-pip-2-${{ hashFiles('**/setup.py', '**/requirements.txt') }} restore-keys: | - ${{ runner.os }}-pip- + ${{ runner.os }}-pip-2- - name: Install dependencies run: | #sudo apt-get install gfortran swig libhdf5-serial-dev libmpich-dev