Skip to content

Conversation

@Shlok2223
Copy link

Added a new 1-D core-collapse supernova model, Takata_2025, simulated in recent work by Takata, T. et al, 2025 PhysRevD.111.103028 in the presence of axion-like particles. The corresponding model files have been added to snewpy-models-ccsn.

Copy link
Member

@JostMigenda JostMigenda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for adding this new model! ✨

I’ve got two initial comments at first glance; haven’t looked at the code in any detail yet, but will try to do this next week, if I find time during a conference.

.DS_Store Outdated
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like you added this file (and a few similar ones in subdirectories) accidentally. Can you please remove them?

(And, optionally, feel welcome to add this to the .gitignore file; to help everyone avoid this in the future.)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I did not realize git add -A will stage these files as well. I will remove them.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you revert these changes please? They're unrelated to this PR.

(Together with the .DS_Store files, this makes me guess that you used git commit -a? Please be very careful with that or try to get out of that habit completely—it makes it really easy to accidentally include unintended files …)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do, thanks for pointing it out.

@Shlok2223
Copy link
Author

Shlok2223 commented Nov 29, 2025

I have made the changes suggested in the above two comments, and have added .DS_Store to the .gitignore file as well.

  1. The Integration Test error regarding Analytic3Species attribute to ccsn_loaders.py still remains.
  2. There is a new ModuleNotFoundError with Flavor Transformation test in test_04_xforms.py. I got rid of it, but there is a new AttributeError that I am seeing when I run the test locally:
______________________________________________________________________ TestFlavorTransformations.test_EarthMatter_NMO ________________________________________________________________________

self = <snewpy.test.test_04_xforms.TestFlavorTransformations object at 0x12996e720>

    @pytest.mark.BEMEWS
    def test_EarthMatter_NMO(self):
        """Earth matter effects with normal ordering.
        """
        src = SkyCoord.from_name('Betelgeuse')
        det = EarthLocation.of_site('SuperK')
        obstime = Time('2021-5-26 14:14:00')
        altaz = src.transform_to(AltAz(obstime=obstime, location=det))
    
        mixing_params = ThreeFlavorMixingParameters(dm21_2=7.42e-5 * u.eV**2, dm31_2=2.517e-3 * u.eV**2,
                                                    theta12=33.45*u.deg, theta13=8.57*u.deg, theta23=49.2*u.deg,
                                                    deltaCP=197*u.deg)
    
        t = np.arange(0, 1, 0.01)<<u.s
        E = np.arange(1, 2, 1)<<u.MeV
    
        xform = xforms.TransformationChain(xforms.in_sn.AdiabaticMSW(),
                                           in_earth=xforms.in_earth.EarthMatter(SNAltAz=altaz),
                                           mixing_params=mixing_params)
    
>       Pfm = xforms.in_earth.EarthMatter(SNAltAz=altaz, mixing_params=mixing_params).P_fm(t, E)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

test_04_xforms.py:700: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
../flavor_transformation/in_earth.py:56: in __init__
    self.mixing_params=mixing_params
    ^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <snewpy.flavor_transformation.in_earth.EarthMatter object at 0x129796120>
val = ThreeFlavorMixingParameters(theta12=<Quantity 33.45 deg>, theta13=<Quantity 8.57 deg>, theta23=<Quantity 49.2 deg>, de...y 7.42e-05 eV2>, dm32_2=<Quantity 0.0024428 eV2>, dm31_2=<Quantity 0.002517 eV2>, mass_order=<MassHierarchy.NORMAL: 1>)

    @mixing_params.setter
    def mixing_params(self, val):
>       return self._mixing_params.update(**val)
               ^^^^^^^^^^^^^^^^^^^
E       AttributeError: 'EarthMatter' object has no attribute '_mixing_params'. Did you mean: 'mixing_params'?

../flavor_transformation/base.py:17: AttributeError
_______________________________________________________________________ 

============================================== short test summary info ===================================================================================
FAILED test_04_xforms.py::TestFlavorTransformations::test_EarthMatter_NMO - AttributeError: 'EarthMatter' object has no attribute '_mixing_params'. Did you mean: 'mixing_params'?
FAILED test_04_xforms.py::TestFlavorTransformations::test_EarthMatter_IMO - AttributeError: 'EarthMatter' object has no attribute '_mixing_params'. Did you mean: 'mixing_params'?
================================================================================ 2 failed, 17 passed in 1.26s =================================================================================

I got the same message for TestFlavorTransformations.test_EarthMatter_IMO. Seems there is mismatch between self._mixing_params used in flavor_transformation/base.py and self.mixing_params used in flavor_transformation/in_earth.py.

@sybenzvi
Copy link
Contributor

sybenzvi commented Dec 2, 2025

The unit test module python/snewpy/test/test_04_xforms.py is just broken in the main branch. This has nothing to do with the new model. Specifically, the failing tests are:

  1. test_EarthMatter_NMO
  2. test_EarthMatter_IMO

All the other unit tests look OK, either passing or with expected failures.

@sybenzvi
Copy link
Contributor

After discussion in the SNEWS2 signal prediction telecon on 2025-12-16, I think we'll just merge the change and then fix the two broken unit tests.

@Shlok2223
Copy link
Author

Noted. Thank you.

@sybenzvi sybenzvi merged commit 2ca7c27 into main Dec 16, 2025
6 of 12 checks passed
@sybenzvi sybenzvi deleted the Shlok2223/new_model_Takata2025 branch December 16, 2025 20:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants