Skip to content

Commit

Permalink
Merge pull request #57 from cosimoNigro/reorganise_data
Browse files Browse the repository at this point in the history
reorganised data files location, now included in the package resources
  • Loading branch information
cosimoNigro committed Dec 8, 2020
2 parents 535e20a + 5c3851a commit 4557264
Show file tree
Hide file tree
Showing 60 changed files with 29 additions and 15 deletions.
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1 +1 @@
include LICENSE
include LICENSE
2 changes: 1 addition & 1 deletion agnpy/absorption/absorption.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

__all__ = ["sigma", "tau_disk_finke_2016", "Absorption", "ebl_files_dict", "EBL"]

agnpy_dir = Path(__file__).parent.parent.parent
agnpy_dir = Path(__file__).parent.parent
ebl_files_dict = {
"franceschini": f"{agnpy_dir}/data/ebl_models/ebl_franceschini08.fits.gz",
"dominguez": f"{agnpy_dir}/data/ebl_models/ebl_dominguez11.fits.gz",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
7 changes: 4 additions & 3 deletions agnpy/tests/test_absorption.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@
import matplotlib.pyplot as plt


agnpy_dir = Path(__file__).parent.parent.parent
agnpy_dir = Path(__file__).parent.parent
# where to read sampled files
data_dir = f"{agnpy_dir}/data"
data_dir = agnpy_dir / "data"
# where to save figures
figures_dir = f"{data_dir}/crosscheck_figures/absorption"
figures_dir = agnpy_dir.parent / "crosschecks/figures/absorption"
figures_dir.mkdir(parents=True, exist_ok=True)

# variables with _test are global and meant to be used in all tests
# here as a default we use the same parameters of Figure 7.4 in Dermer Menon 2009
Expand Down
10 changes: 6 additions & 4 deletions agnpy/tests/test_compton.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@
from .utils import make_comparison_plot, extract_columns_sample_file, check_deviation
from agnpy.utils.math import trapz_loglog

agnpy_dir = Path(__file__).parent.parent.parent

agnpy_dir = Path(__file__).parent.parent
# where to read sampled files
data_dir = f"{agnpy_dir}/data"
data_dir = agnpy_dir / "data"
# where to save figures
figures_dir = f"{data_dir}/crosscheck_figures/compton"
figures_dir = agnpy_dir.parent / "crosschecks/figures/compton"
figures_dir.mkdir(parents=True, exist_ok=True)

# variables with _test are global and meant to be used in all tests
pwl_spectrum_norm_test = 1e48 * u.Unit("erg")
Expand Down Expand Up @@ -49,7 +51,7 @@
bpwl_blob_test = Blob(
1e16 * u.cm, 1, 40, 40, 0.56 * u.G, bpwl_spectrum_norm_test, bpwl_dict_test,
)
bpwl_blob_test.set_gamma_size(400)
bpwl_blob_test.set_gamma_size(350)
# global disk
M_BH = 1.2 * 1e9 * M_sun.cgs
L_disk = 2e46 * u.Unit("erg s-1")
Expand Down
9 changes: 6 additions & 3 deletions agnpy/tests/test_synchrotron.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,14 @@
check_deviation,
)

agnpy_dir = Path(__file__).parent.parent.parent

agnpy_dir = Path(__file__).parent.parent
# where to read sampled files
data_dir = f"{agnpy_dir}/data"
data_dir = agnpy_dir / "data"
# where to save figures
figures_dir = f"{data_dir}/crosscheck_figures/synchrotron"
figures_dir = agnpy_dir.parent / "crosschecks/figures/synchrotron"
figures_dir.mkdir(parents=True, exist_ok=True)


# variables with _test are global and meant to be used in all tests
# here as a default we use the same parameters of Figure 7.4 in Dermer Menon 2009
Expand Down
2 changes: 2 additions & 0 deletions agnpy/tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,3 +130,5 @@ def make_comparison_plot(
ax[1].axvline(comparison_range[0], ls="--", color="k")
ax[1].axvline(comparison_range[1], ls="--", color="k")
fig.savefig(f"{fig_path}")
# avoid RuntimeWarning: More than 20 figures have been opened.
plt.close(fig)
1 change: 0 additions & 1 deletion agnpy/utils/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ def plot_sed(nu, sed, ax=None, **kwargs):
comparison_range : list of float
plot the range over which the residuals were checked
"""
load_mpl_rc()
ax = plt.gca() if ax is None else ax

ax.loglog(nu, sed, **kwargs)
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
author = "Cosimo Nigro"

# The full version, including alpha/beta/rc tags
release = "0.0.7.9"
release = "0.0.8"


# -- General configuration ---------------------------------------------------
Expand Down
9 changes: 8 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,21 @@

setuptools.setup(
name="agnpy",
version="0.0.7.9",
version="0.0.8",
author="Cosimo Nigro",
author_email="cosimonigro2@gmail.com.com",
description="Modelling jetted Active Galactic Nuclei radiative processes with python",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/cosimoNigro/agnpy",
packages=setuptools.find_packages(),
package_data={
"agnpy": [
"data/sampled_seds/*.txt",
"data/sampled_taus/*.txt",
"data/ebl_models/*.fits.gz",
]
},
include_package_data=True,
classifiers=[
"Programming Language :: Python :: 3",
Expand Down

0 comments on commit 4557264

Please sign in to comment.