Skip to content

Commit

Permalink
starting refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
mfouesneau committed Oct 2, 2024
1 parent 405046d commit 44beb48
Show file tree
Hide file tree
Showing 7 changed files with 687 additions and 26 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/ruff.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Ruff
on: [push, pull_request]
jobs:
ruff:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: chartboost/ruff-action@v1
with:
src: "./src"
args: "format"
2 changes: 1 addition & 1 deletion ezpadova/simpletable.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
""" This file implements a Table class
r""" This file implements a Table class
that is designed to be the basis of any format
Requirements
Expand Down
62 changes: 62 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
[project]
name = "ezpadova"
version = "2.0"
description = "A python package that allows you to download PADOVA/PARSEC isochrones directly from their website"
readme = "README.md"
requires-python = ">=3.9"
dependencies = [
"requests",
"pandas",
]
authors = [{name="Morgan Fouesneau"}]
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Science/Research',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Topic :: Scientific/Engineering :: Astronomy'
]

[build-system]
requires = ["setuptools>=60",
"setuptools-scm>=6.2",
"wheel",
]
build-backend = "setuptools.build_meta"

[tool.setuptools]
# By default, include-package-data is true in pyproject.toml, so you do
# NOT have to specify this line.
include-package-data = true

[tool.setuptools.packages.find]
where = ["src"] # list of folders that contain the packages (["."] by default)
include = ["ezpadova*"] # package names should match these glob patterns (["*"] by default)
exclude = ["ezpadova.tests*"] # exclude packages matching these glob patterns (empty by default)
namespaces = true # to disable scanning PEP 420 namespaces (true by default)

[tool.setuptools.package-data]
# Examples
# "*" = ["*.txt"]
#my_package = ["*.txt", "*.rst"]
#my_package.data = ["*.txt", "*.rst"] # for subfolder of my_package
ezpadova = ['*.json']

[project.optional-dependencies]

testing = [
"pytest",
"pytest-doctestplus",
"ruff",
"codecov",
"pytest-cov"]

ci = [
"toml",
"ruff",
"isort"]

docs = [
"sphinx",
"sphinx-automodapi",
"numpydoc"]
25 changes: 0 additions & 25 deletions setup.py

This file was deleted.

4 changes: 4 additions & 0 deletions src/ezpadova/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from .parsec import get_Z_isochrones, get_one_isochrone, get_t_isochrones
from . import parsec

__version__ = "2.0.0"
150 changes: 150 additions & 0 deletions src/ezpadova/parsec.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
{
"webserver" : "http://stev.oapd.inaf.it",
"map_interp" : {
"default": 0,
"improved": 1
},
"map_phot": {
"2mass_spitzer": " 2MASS + Spitzer (IRAC+MIPS)",
"2mass_spitzer_wise": " 2MASS + Spitzer (IRAC+MIPS) + WISE",
"2mass": " 2MASS JHKs",
"ubvrijhk": "UBVRIJHK (cf. Maiz-Apellaniz 2006 + Bessell 1990)",
"bessell": "UBVRIJHKLMN (cf. Bessell 1990 + Bessell & Brett 1988)",
"akari": "AKARI",
"batc": "BATC",
"megacam": "CFHT/Megacam u*g'r'i'z'",
"dcmc": "DCMC",
"denis": "DENIS",
"dmc14": "DMC 14 filters",
"dmc15": "DMC 15 filters",
"eis": "ESO/EIS (WFI UBVRIZ + SOFI JHK)",
"wfi": "ESO/WFI",
"wfi_sofi": "ESO/WFI+SOFI",
"wfi2": "ESO/WFI2",
"galex": "GALEX FUV+NUV (Vegamag) + Johnson's UBV",
"galex_sloan": "GALEX FUV+NUV + SDSS ugriz (all ABmags) ",
"UVbright": "HST+GALEX+Swift/UVOT UV filters",
"acs_hrc": "HST/ACS HRC",
"acs_wfc": "HST/ACS WFC",
"nicmosab": "HST/NICMOS AB",
"nicmosst": "HST/NICMOS ST",
"nicmosvega": "HST/NICMOS vega",
"stis": "HST/STIS imaging mode",
"wfc3ir": "HST/WFC3 IR channel (final throughputs)",
"wfc3uvis1": "HST/WFC3 UVIS channel, chip 1 (final throughputs)",
"wfc3uvis2": "HST/WFC3 UVIS channel, chip 2 (final throughputs)",
"wfc3_medium": "HST/WFC3 medium filters (UVIS1+IR, final throughputs)",
"wfc3": "HST/WFC3 wide filters (UVIS1+IR, final throughputs)",
"wfpc2": "HST/WFPC2 (Vegamag, cf. Holtzman et al. 1995)",
"kepler": "Kepler + SDSS griz + DDO51 (in ABmags)",
"kepler_2mass": "Kepler + SDSS griz + DDO51 (in ABmags) + 2MASS (~Vegamag)",
"ogle": "OGLE-II",
"panstarrs1": "Pan-STARRS1",
"sloan": "SDSS ugriz",
"sloan_2mass": "SDSS ugriz + 2MASS JHKs",
"sloan_ukidss": "SDSS ugriz + UKIDSS ZYJHK",
"swift_uvot": "SWIFT/UVOT UVW2, UVM2, UVW1,u (Vegamag) ",
"spitzer": "Spitzer IRAC+MIPS",
"stroemgren": "Stroemgren-Crawford",
"suprimecam": "Subaru/Suprime-Cam (ABmags)",
"tycho2": "Tycho VTBT",
"ukidss": "UKIDSS ZYJHK (Vegamag)",
"visir": "VISIR",
"vista": "VISTA ZYJHKs (Vegamag)",
"washington": "Washington CMT1T2",
"washington_ddo51": "Washington CMT1T2 + DDO51",
"ogle_2mass_spitzer": " OGLE + 2MASS + Spitzer (IRAC+MIPS)",
"2mass_spitzer_wise_washington_ddo51": "2MASS+Spitzer+WISE+Washington+DDO51",
"megacam_wircam": "CFHT Megacam + Wircam (all ABmags)",
"wircam": "CFHT Wircam",
"ciber": "CIBER",
"decam": "DECAM (ABmags)",
"decam_vista": "DECAM ugrizY (ABmags) + VISTA ZYJHK_s (Vegamags)",
"gaia": "Gaia's G, G_BP and G_RP (Vegamags)",
"wfc3_wideverywide": "HST/WFC3 all W+LP+X filters (UVIS1+IR, final throughputs)",
"wfc3_verywide": "HST/WFC3 long-pass and extremely wide filters (UVIS1, final throughputs)",
"wfc3_wide": "HST/WFC3 wide filters (UVIS1+IR, final throughputs)",
"int_wfc": "INT/WFC (Vegamag)",
"iphas": "IPHAS",
"lbt_lbc": "LBT/LBC (Vegamag)",
"lsst": "LSST ugrizY, March 2012 total filter throughputs (all ABmags)",
"noao_ctio_mosaic2": "NOAO/CTIO/MOSAIC2 (Vegamag)",
"TESS_2mass_kepler": "TESS + 2MASS (Vegamags) + Kepler + SDSS griz + DDO51 (in ABmags)",
"ukidss": "UKIDSS ZYJHK (Vegamag)",
"vphas": "VPHAS+ (ABmags)",
"vst_omegacam": "VST/OMEGACAM (ABmag)",
"vilnius": "Vilnius",
"jwst_wide": "planned JWST wide filters"
},
"map_models": {
"parsec12s_r14": ["parsec_CAF09_v1.2S_NOV13", "PARSEC version 1.2S Bressan et al. (2012), Tang et al. (2014), Chen et al. (2014) with COLIBRI TP-AGB Marigo et al. (2013), Rosenfield et al. (2014, 2016)"],
"parsec12s": ["parsec_CAF09_v1.2S", "PARSEC version 1.2S, Bressan et al. (2012), Tang et al. (2014), Chen et al. (2014)"],
"parsec11": ["parsec_CAF09_v1.1", "PARSEC version 1.1, With revised diffusion+overshooting in low-mass stars, and improvements in interpolation scheme."],
"parsec10": ["parsec_CAF09_v1.0", "PARSEC version 1.0"],
"2010": ["gi10a", "Marigo et al. (2008) with the Girardi et al. (2010) Case A correction for low-mass, low-metallicity AGB tracks"],
"2010b": ["gi10b", "Marigo et al. (2008) with the Girardi et al. (2010) Case B correction for low-mass, low-metallicity AGB tracks"],
"2008": ["ma08", "Marigo et al. (2008): Girardi et al. (2000) up to early-AGB + detailed TP-AGB from Marigo & Girardi (2007) (for M <= 7 Msun) + Bertelli et al. (1994) (for M > 7 Msun) + additional Z=0.0001 and Z=0.001 tracks."],
"2002": ["gi2000", "Basic set of Girardi et al. (2002) : Girardi et al. (2000) + simplified TP-AGB (for M <= 7 Msun) + Bertelli et al. (1994) (for M > 7 Msun) + additional Z=0.0001 and Z=0.001 tracks."]
},
"map_carbon_stars" : {
"loidl": ["loidl01", "Loidl et al. (2001) (as in Marigo et al. (2008) and Girardi et al. (2008))"],
"aringer": ["aringer09", "Aringer et al. (2009) (Note: The interpolation scheme has been slightly improved w.r.t. to the paper's Fig. 19."]
},
"map_circum_Mstars": {
"nodustM": ["nodustM", "no dust"],
"sil": ["sil", "Silicates as in Bressan et al. (1998)"],
"AlOx": ["AlOx", "100% AlOx as in Groenewegen (2006)"],
"dpmod60alox40": ["dpmod60alox40", "60% Silicate + 40% AlOx as in Groenewegen (2006)"],
"dpmod": ["dpmod", "100% Silicate as in Groenewegen (2006)"],
"Rouleau13_jan17": ["Rouleau13_jan17", "M+C Model: Rouleau & Martin (1991) logεS=-13 (see Nanni et al. (2016))"],
"Jaeger400_12_jan17": ["Jaeger400_12_jan17", "M+C Model: Jaeger et al. (1998) 400K, logεS=-12 (see Nanni et al. (2016))"],
"Rouleau12_mar17": ["Rouleau12_mar17", "M+C Model: Rouleau & Martin (1991) logεS=-12 (see Nanni et al. (2016))"]
},
"map_circum_Cstars": {
"nodustC": ["nodustC", "no dust"],
"gra": ["gra", "Graphites as in Bressan et al. (1998)"],
"AMC": ["AMC", "100% AMC as in Groenewegen (2006)"],
"AMCSIC15": ["AMCSIC15", "85% AMC + 15% SiC as in Groenewegen (2006)"]
},
"map_isoc_val" : {
"0": [0, "Single isochrone"],
"1": [1, "Sequence of isochrones at constant Z"],
"2": [2, "Sequence of isochrones at constant t (variable Z)"]
},
"__def_args__": {
"n_inTPC": 10,
"cmd_version": 2.9,
"dust_sourceC": "nodustC",
"dust_sourceM": "nodustM",
"eta_reimers": 0.2,
"extinction_av": 0,
"imf_file": "tab_imf/imf_chabrier_lognormal.dat",
"isoc_age": 1e7,
"isoc_age0": 12.7e9,
"isoc_dlage": 0.05,
"isoc_dz": 0.0001,
"isoc_kind": "parsec_CAF09_v1.2S_NOV13",
"isoc_lage0": 6.6,
"isoc_lage1": 10.13,
"isoc_val": 0,
"isoc_z0": 0.0001,
"isoc_z1": 0.03,
"isoc_zeta": 0.02,
"isoc_zeta0": 0.008,
"kind_cspecmag": "aringer09",
"kind_dust": 0,
"kind_interp": 1,
"kind_mag": 2,
"kind_postagb": -1,
"kind_pulsecycle": 0,
"kind_tpagb": 0,
"lf_deltamag": 0.2,
"lf_maginf": 20,
"lf_magsup": -20,
"output_evstage": 0,
"output_gzip": 0,
"output_kind": 0,
"photsys_file": "tab_mag_odfnew/tab_mag_bessell.dat",
"photsys_version": "yang",
"submit_form": "Submit"}
}
Loading

0 comments on commit 44beb48

Please sign in to comment.