Coder Social home page Coder Social logo

egentry / clustered_sne Goto Github PK

View Code? Open in Web Editor NEW
4.0 4.0 2.0 15.27 MB

Riemann solver with cooling, for the Sedov and cooling phases of a supernova remnant

License: GNU General Public License v3.0

C 0.06% Makefile 0.11% Python 2.44% Fortran 0.64% Shell 0.06% C++ 2.90% Jupyter Notebook 93.77% Objective-C 0.02%

clustered_sne's People

Contributors

chomps avatar duffell avatar egentry avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

clustered_sne's Issues

restarting a run can lead to incorrect "Number of SNe" in overview.dat file

If you restart a run which already has had SNe occur, but with no *_overview.dat file present, then the *_overview.dat file might list too few SNe under the field "Number of SNe"

In particular, I've restarted an 11 SNe run after 1 SNe has gone off, and the *_overview.dat is created saying:
Number of SNe: 10
which breaks my RunSummary (python object) constructor.

RunSummary fails when calculating number of zones

(Error message at bottom. First noticed by Ben Wibking)

Things work fine when I run on an up-to-date Python 3.5 installation, but fail when I run with a Python 2.7 installation and the default Anaconda 4.0.0 packages.

TypeError                                 Traceback (most recent call last)
/Users/egentry/Dropbox/data/clustered_SNe/analysis/../../clustered_SNe/analysis/visualize_helpers.pyc in single_run(data_dir, id)
    241         raise FileNotFoundError("No directory found named: "+ data_dir)
    242 
--> 243     run_summary = RunSummary(data_dir=data_dir, id=id)
    244     sedov_solution = SedovSolution(E_0,
    245                                    run_summary.overview.background_density,

/Users/egentry/Dropbox/data/clustered_SNe/analysis/../../clustered_SNe/analysis/parse.pyc in __init__(self, data_dir, id)
    169             M_tot[k]    = df_tmp.M_int.iloc[-1]
    170             Z_tot[k]    = np.sum(df_tmp.Mass * df_tmp.Z)
--> 171             zones[k]    = df_tmp.shape[0]
    172 
    173             over_dense = np.where(df_tmp.Density > overview.background_density * 1.0001)[0]

TypeError: 'int' object does not support item assignment`

`single_run` no longer clears previous subwidgets with recent versions of ipywidgets

In version 6.0.0 of ipywidgets, my single_run function no longer works properly with ipywidgets interactive functionality. This can most clearly be seen in my analysis/visualize.ipynb notebook.

Previously I had a hackish solution for first choosing a simulation and loading it interactively, and then plotting a specific view interactively. This shouldn't be done in a single interact function, because I don't need to reparse the entire simulation every time I want to change my axis limits. So I had nested interact calls, which would try to clear previous widgets whenever I chose a new simulation. Unfortunately interact gives a slightly different output now, which breaks my previous assumptions. My fault for designing things in a way that they didn't recommend.

For now, you can get around this by simple re-running the entire cell that contains the interact(single_run) statement. This should clear all previous widgets, at the cost of losing all the custom options you've configured.

For a medium-term solution, I'm guessing you could fix single_run to point at the correct element in children, and clear that instead (possibly breaking backwards compatibility w.r.t. ipywidgets.

For a long-term solution, you should design widgets that actually interact with each other in the way that ipywidgets assumed. This is fairly complex for the datatypes I want to interact with, so I don't plan to implement this fix.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.