diff --git a/.github/workflows/continous_integration.yml b/.github/workflows/continous_integration.yml index cc518763..2f331914 100644 --- a/.github/workflows/continous_integration.yml +++ b/.github/workflows/continous_integration.yml @@ -7,10 +7,10 @@ on: # Triggers the workflow on push or pull request events but only for the main branch push: branches: - - main + - master pull_request: branches: - - main + - master # Allows you to run this workflow manually from the Actions tab workflow_dispatch: diff --git a/flarestack/core/results.py b/flarestack/core/results.py index 1875644b..dc78ae25 100644 --- a/flarestack/core/results.py +++ b/flarestack/core/results.py @@ -719,6 +719,7 @@ def f(x, a, b, c): # this trick could be replaced by calling f on the vector of best fit parameters best_f = None + interpolated_flux = np.nan try: res = scipy.optimize.curve_fit( @@ -739,13 +740,10 @@ def best_f(x): # estimate the solution flux interpolated_flux = scipy.stats.gamma.ppf(0.5, best_a, best_b, best_c) - # "disc_potential" and "disc_potential_25" attributes are set here - # use of `setattr` makes the code a bit obscure and could be improved - discovery_flux[zval] = k_to_flux(interpolated_flux) - except RuntimeError as e: logger.warning(f"RuntimeError for discovery potential!: {e}") - # interpolated_flux = np.nan + + discovery_flux[zval] = k_to_flux(interpolated_flux) # now plot the whole ordeal xrange = np.linspace(0.0, 1.1 * max(x), 1000) @@ -765,7 +763,7 @@ def best_f(x): ax1.axvline(k_to_flux(interpolated_flux), lw=2, color="red") ax1.set_ylim(0.0, 1.0) ax1.set_xlim(0.0, k_to_flux(max(xrange))) - ax1.set_ylabel(r"Overfluctuations relative to f{zval}$\sigma$ threshold") + ax1.set_ylabel(rf"Overfluctuations relative to {zval}$\sigma$ threshold") plt.xlabel(r"Flux Normalisation @ 1GeV [ GeV$^{-1}$ cm$^{-2}$ s$^{-1}$]") if not np.isnan(self.flux_to_ns):