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

pandas warning on config ? #105

Closed
ssim opened this issue Mar 24, 2014 · 4 comments
Closed

pandas warning on config ? #105

ssim opened this issue Mar 24, 2014 · 4 comments

Comments

@ssim
Copy link
Contributor

ssim commented Mar 24, 2014

I pulled from Master today. With the current version I got the following warning:

radial1d = model.Radial1DModel(tardis_config)
/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pandas/core/frame.py:2536: SettingWithCopyWarning: A value is trying to be set on a copy of a slice from a DataFrame
inplace=inplace)

it's only a warning (not an error) but it didn't happen before. Sounds like something we should clean up. Can someone tell me if something in this config file is not really valid now (@wkerzendorf @mklauser)?

The config file I used was:

#Currently only simple1d is allowed
tardis_config_version: v1.0
supernova:
    luminosity_requested: 9.44 log_lsun
    time_explosion: 13 day
#    distance : 24.2 Mpc

atom_data: kurucz_atom_pure.h5


model:

    structure:
        type: specific

        velocity:
            start : 11000 km/s
            stop : 20000 km/s
            num: 20

        density:
            type : uniform
            value: 1.e-14 g/cm3

    abundances:
        type: uniform
        O: 0.19
        Mg: 0.03
        Si: 0.52
        S: 0.19
        Ar: 0.04
        Ca: 0.03

plasma:
    disable_electron_scattering: no
    ionization: nebular
    excitation: dilute-lte
    radiative_rates_type: dilute-blackbody
    line_interaction_type: scatter

montecarlo:
    seed: 23111963
    no_of_packets : 1.0e+5
    iterations: 10

    black_body_sampling:
        start: 1 angstrom
        stop: 1000000 angstrom
        num: 1.e+6
    last_no_of_packets: 1.e+5
    no_of_virtual_packets: 10

    convergence_criteria:
        type: specific
        damping_constant: 1.0
        threshold: 0.05
        fraction: 0.8
        hold: 3
        t_inner:
            damping_constant: 1.0

spectrum:
    start : 500 angstrom
    stop : 20000 angstrom
    num: 10000

@wkerzendorf
Copy link
Member

@ssim Öha like our austrian neighbours say - that shouldn't be. I've encountered that before and think that this has to do with versioning of pandas (can you give the pandas version). In tardisatomic, this warning actually caused a wrong output if I remember correctly. I think, we really need to get on merging #92 and getting the new atomic datasets on the website so we can run a test each time at least making sure that the output spectrum is the same.

@ssim
Copy link
Contributor Author

ssim commented Mar 24, 2014

@wkerzendorf my pandas version is 0.13.1, which I believe is the most recent

@ssim
Copy link
Contributor Author

ssim commented Mar 24, 2014

I have tracked the issue to line 480ish in atomic.py.

Proposed solution is to add line to make:

        #cutting levels_lines
        self.lines = self.lines_data[self.lines_data['atomic_number'].isin(self.selected_atomic_numbers)]

        if max_ion_number is not None:
            self.lines = self.lines[self.lines['ion_number'] <= max_ion_number]

        self.lines.is_copy = False

        self.lines.sort('wavelength', inplace=True)

Apparently the error is because the operation making self.lines here thinks it's a copy. @wkerzendorf Thoughts about this? Is there a better way to write this?

@ssim
Copy link
Contributor Author

ssim commented Apr 15, 2014

This is now resolved.

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 a pull request may close this issue.

2 participants