Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EOS deprecations #360

Merged
merged 2 commits into from
Aug 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 1 addition & 17 deletions doc/nb/ccsn/Fischer_2020.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -36,23 +36,7 @@
"source": [
"## Initialize Models\n",
"\n",
"To start, let’s see what progenitors are available for the `Fischer_2020` model. We can use the `param` property to view all physics parameters and their possible values:"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"Fischer_2020.param"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"In this case, there’s just a single progenitor available; so let’s initialize it. If this is the first time you’re using this progenitor, snewpy will automatically download the required data files for you."
"For the `Fischer_2020` model, there’s just a single progenitor available; so let’s initialize it. If this is the first time you’re using this progenitor, snewpy will automatically download the required data files for you."
]
},
{
Expand Down
17 changes: 11 additions & 6 deletions python/snewpy/models/ccsn.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,14 @@ class method to get a list of all valid combinations and filter it:
from snewpy.models.registry_model import all_models
from textwrap import dedent

@legacy_filename_initialization
@RegistryModel(
progenitor_mass= [18 * u.Msun],
eos = ['HS(DD2)']
)

@RegistryModel()
class Fischer_2020(loaders.Fischer_2020):
"""Model based on simulations from `Fischer et al. (2020) <https://arxiv.org/abs/1804.10890>`
"""
def __init__(self, progenitor_mass:u.Quantity, eos:str):
def __init__(self):
self.metadata["EOS"] = "HS(DD2)"
self.metadata["Progenitor mass"] = 18 * u.Msun
filename='Fischer_2020.tar.gz'
return super().__init__(filename, metadata=self.metadata)

Expand Down Expand Up @@ -127,6 +126,7 @@ def __init__(self, progenitor_mass:u.Quantity, eos:str):
return super().__init__(filename, self.metadata)


@deprecated('eos')
@legacy_filename_initialization
@RegistryModel(
progenitor_mass = [11.2, 20., 27.] * u.Msun,
Expand All @@ -145,6 +145,8 @@ def __init__(self, *, progenitor_mass:u.Quantity, direction:int):
# Metadata is handled by __init__ in _GarchingArchiveModel
return super().__init__(filename=filename, metadata=self.metadata)


@deprecated('eos')
@legacy_filename_initialization
@RegistryModel(
progenitor_mass= [11.2, 27.] * u.Msun,
Expand All @@ -158,6 +160,8 @@ def __init__(self, progenitor_mass:u.Quantity, eos:str='LS220'):
filename = f's{progenitor_mass.value:3.1f}c'
return super().__init__(filename=filename, metadata=self.metadata)


@deprecated('eos')
@legacy_filename_initialization
@RegistryModel(
progenitor_mass = [15.] * u.Msun,
Expand All @@ -176,6 +180,7 @@ def __init__(self, *, progenitor_mass:u.Quantity, rotation:str, direction:int):
return super().__init__(filename=filename, metadata=self.metadata)


@deprecated('eos')
@legacy_filename_initialization
@RegistryModel(
progenitor_mass = [40., 75.] * u.Msun,
Expand Down