egentry / clustered_sne Goto Github PK
View Code? Open in Web Editor NEWRiemann solver with cooling, for the Sedov and cooling phases of a supernova remnant
License: GNU General Public License v3.0
Riemann solver with cooling, for the Sedov and cooling phases of a supernova remnant
License: GNU General Public License v3.0
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.
(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`
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.