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

Making a deepcopy breaks cosmo_array.to_physical() #184

Open
mladenivkovic opened this issue Mar 4, 2024 · 1 comment
Open

Making a deepcopy breaks cosmo_array.to_physical() #184

mladenivkovic opened this issue Mar 4, 2024 · 1 comment
Assignees

Comments

@mladenivkovic
Copy link
Collaborator

        data = swiftsimio.load(snapshot_name)
        gas = data.gas

        u = gas.internal_energies

        #  print(u[:1])
        #  [0.00100253] 1.0459449255936e-6*Mpc**2/Gyr**2 (Comoving)

        u1 = copy.deepcopy(u)

        #  print(u1[:1])
        #  [1.0485887e-15] kpc**2/kyr**2 (Comoving)

        #  print(type(u1))
        # <class 'swiftsimio.objects.cosmo_array'>

        u1.to_physical()

        #  Traceback (most recent call last):
        #    File "/home/mivkov/Downloads/CosmoHeatingTest_zipped/./plotSolution.py", line 280, in <module>
        #      t, T, mu, mass_fraction, u, photon_energies = get_snapshot_data(snaplist)
        #    File "/home/mivkov/Downloads/CosmoHeatingTest_zipped/./plotSolution.py", line 213, in get_snapshot_data
        #      u1.to_physical()
        #    File "/home/mivkov/local/swiftsimio/swiftsimio/objects.py", line 907, in to_physical
        #      copied_data.convert_to_physical()
        #    File "/home/mivkov/local/swiftsimio/swiftsimio/objects.py", line 892, in convert_to_physical
        #      values *= self.cosmo_factor.a_factor
        #  AttributeError: 'NoneType' object has no attribute 'a_factor'

@MatthieuSchaller
Copy link
Member

Possibly also one issue that will be solved by the changes @robjmcgibbon is looking at.

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

No branches or pull requests

3 participants