[Yt-svn] commit/yt: 4 new changesets
Bitbucket
commits-noreply at bitbucket.org
Tue Apr 12 07:40:47 PDT 2011
4 new changesets in yt:
http://bitbucket.org/yt_analysis/yt/changeset/3396995898d5/
changeset: r4100:3396995898d5
branch: yt
user: MatthewTurk
date: 2011-04-07 01:50:28
summary: Moved the buttons into a menu. Not all the menu items are functional yet.
affected #: 3 files (7.6 KB)
--- a/yt/gui/reason/html/index.html Wed Apr 06 17:00:56 2011 -0400
+++ b/yt/gui/reason/html/index.html Wed Apr 06 19:50:28 2011 -0400
@@ -86,6 +86,9 @@
<!-- THE MAIN FUNCTION --><script type="text/javascript" src="js/reason.js"></script>
+ <!-- THE MENU ITEMS AND FUNCTIONS -->
+ <script type="text/javascript" src="js/menu_items.js"></script>
+
<!-- THE PLOT WINDOW FUNCTIONS --><script type="text/javascript" src="js/widget_plotwindow.js"></script></head>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/yt/gui/reason/html/js/menu_items.js Wed Apr 06 19:50:28 2011 -0400
@@ -0,0 +1,97 @@
+/**********************************************************************
+The main GUI facility for Reason
+
+Author: Cameron Hummels <chummels at gmail.com>
+Affiliation: Columbia
+Author: Jeffrey S. Oishi <jsoishi at gmail.com>
+Affiliation: KIPAC/SLAC/Stanford
+Author: Britton Smith <brittonsmith at gmail.com>
+Affiliation: MSU
+Author: Matthew Turk <matthewturk at gmail.com>
+Affiliation: NSF / Columbia
+Homepage: http://yt.enzotools.org/
+License:
+ Copyright (C) 2011 Matthew Turk. All Rights Reserved.
+
+ This file is part of yt.
+
+ yt is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+***********************************************************************/
+
+var main_menu = {
+ text: 'Menu',
+ id: 'main_menu',
+ menu: [
+ {xtype:'menuitem', text: 'Open'},
+ {xtype:'menuitem', text: 'Open Directory'},
+ {xtype: 'menuseparator'},
+ {xtype:'menuitem', text: 'Save Script',
+ handler: function (b,e) {
+ Ext.Msg.prompt("We have important work to do.",
+ "Enter filename.",
+ function(btn, text) {
+ if (btn == 'ok'){
+ yt_rpc.ExtDirectREPL.save_session({filename:text},
+ function(f, a) {
+ if (a.result['status'] == 'SUCCESS') {
+ var alert_text = 'Saved session to ' +
+ a.result['filename']
+ Ext.Msg.alert('Success!', alert_text);
+ var record = new logging_store.recordType(
+ {record: alert_text });
+ logging_store.add(record, number_log_records++);
+ } else {
+ Ext.Msg.alert('Always naysaying!',
+ 'Failed to save to ' +
+ a.result['filename'] +
+ '<br>Error: ' +
+ a.result['error']);
+ }
+ });
+ }
+ });
+ } },
+ {xtype:'menuitem', text: 'Download Script',
+ handler: function(b, e) {
+ window.open("session.py", "_top");
+ var record = new logging_store.recordType({
+ record: 'Saved session locally.'});
+ logging_store.add(record, number_log_records++);
+ }},
+ {xtype:'menuitem', text: 'Pastebin Script',
+ handler: function (b,e) {
+ yt_rpc.ExtDirectREPL.paste_session({}, function(f, a) {
+ if (a.result['status'] == 'SUCCESS') {
+ var alert_text = 'Pasted session to:<br>' +
+ a.result['site']
+ var alert_text_rec = 'Pasted session to: ' +
+ a.result['site']
+ Ext.Msg.alert('Pastebin', alert_text);
+ var record = new logging_store.recordType(
+ {record: alert_text_rec });
+ logging_store.add(record, number_log_records++);
+ }
+ });
+ }},
+ {xtype: 'menuseparator'},
+ {xtype:'menuitem', text: 'Help',
+ handler: function (b,e) {
+ window.open("help.html", "_new");
+ }},
+ {xtype:'menuitem', text: 'IRC'},
+ {xtype: 'menuseparator'},
+ {xtype:'menuitem', text: 'Quit'},
+ ],
+};
+
--- a/yt/gui/reason/html/js/reason.js Wed Apr 06 17:00:56 2011 -0400
+++ b/yt/gui/reason/html/js/reason.js Wed Apr 06 19:50:28 2011 -0400
@@ -192,88 +192,6 @@
}
});
- var ButtonGroupPanel = new Ext.Panel({
- layout: 'anchor',
- ButtonAlign: 'center',
- collapsible: false,
- renderTo: document.body,
- tbar: [{
- xtype: 'buttongroup',
- columns: 7,
- items: [{
- text: 'Download',
- layout:'anchor',
- anchor: '100% 25%',
- handler: function(b, e) {
- window.open("session.py", "_top");
- var record = new logging_store.recordType({
- record: 'Saved session locally.'});
- logging_store.add(record, number_log_records++);
- }
- },{
- xtype: 'tbseparator'
- },{
- text: 'Save',
- layout:'anchor',
- anchor: '100% 50%',
- handler: function (b,e) {
- Ext.Msg.prompt("We have important work to do.",
- "Enter filename.",
- function(btn, text) {
- if (btn == 'ok'){
- yt_rpc.ExtDirectREPL.save_session({filename:text},
- function(f, a) {
- if (a.result['status'] == 'SUCCESS') {
- var alert_text = 'Saved session to ' +
- a.result['filename']
- Ext.Msg.alert('Success!', alert_text);
- var record = new logging_store.recordType(
- {record: alert_text });
- logging_store.add(record, number_log_records++);
- } else {
- Ext.Msg.alert('Always naysaying!',
- 'Failed to save to ' +
- a.result['filename'] +
- '<br>Error: ' +
- a.result['error']);
- }
- });
- }
- });
- }
- },{
- xtype: 'tbseparator'
- },{
- text: 'Paste',
- layout:'anchor',
- anchor: '100% 75%',
- handler: function (b,e) {
- yt_rpc.ExtDirectREPL.paste_session({}, function(f, a) {
- if (a.result['status'] == 'SUCCESS') {
- var alert_text = 'Pasted session to:<br>' +
- a.result['site']
- var alert_text_rec = 'Pasted session to: ' +
- a.result['site']
- Ext.Msg.alert('Pastebin', alert_text);
- var record = new logging_store.recordType(
- {record: alert_text_rec });
- logging_store.add(record, number_log_records++);
- }
- });
- }
- },{
- xtype: 'tbseparator'
- },{
- text: 'Help',
- layout:'anchor',
- anchor: '100% 100%',
- handler: function (b,e) {
- window.open("help.html", "_new");
- }
- }]
- }]
- });
-
var status_panel;
var logging_store = new Ext.data.Store({
fields: [{name:'record'}],
@@ -330,8 +248,10 @@
type: 'anchor',
},
items: [
+ {xtype: 'toolbar',
+ items: [ main_menu ],
+ },
treePanel,
- ButtonGroupPanel
]
// in this instance the TabPanel is not wrapped by another panel
// since no title is needed, this Panel is added directly
http://bitbucket.org/yt_analysis/yt/changeset/625287bf8838/
changeset: r4101:625287bf8838
branch: yt
user: MatthewTurk
date: 2011-04-07 04:01:53
summary: Shutdown now works. Disabled non-functional items.
affected #: 1 file (476 bytes)
--- a/yt/gui/reason/html/js/menu_items.js Wed Apr 06 19:50:28 2011 -0400
+++ b/yt/gui/reason/html/js/menu_items.js Wed Apr 06 22:01:53 2011 -0400
@@ -33,8 +33,8 @@
text: 'Menu',
id: 'main_menu',
menu: [
- {xtype:'menuitem', text: 'Open'},
- {xtype:'menuitem', text: 'Open Directory'},
+ {xtype:'menuitem', text: 'Open', disabled: true},
+ {xtype:'menuitem', text: 'Open Directory', disabled: true},
{xtype: 'menuseparator'},
{xtype:'menuitem', text: 'Save Script',
handler: function (b,e) {
@@ -89,9 +89,19 @@
handler: function (b,e) {
window.open("help.html", "_new");
}},
- {xtype:'menuitem', text: 'IRC'},
+ {xtype:'menuitem', text: 'yt Chat',
+ handler: function (b,e) {
+ window.open("http://yt.enzotools.org/irc.html", "_new");
+ }},
{xtype: 'menuseparator'},
- {xtype:'menuitem', text: 'Quit'},
+ {xtype:'menuitem', text: 'Quit',
+ handler: function(b,e) {
+ yt_rpc.ExtDirectREPL.shutdown({}, function(f,a) {
+ Ext.Msg.alert("Goodbye!", "Goodbye from Reason!", function() {
+ window.open("http://www.google.com/", "_top");});});
+ }
+ },
+
],
};
http://bitbucket.org/yt_analysis/yt/changeset/3643571b7ee5/
changeset: r4102:3643571b7ee5
branch: yt
user: MatthewTurk
date: 2011-04-07 05:12:33
summary: Heartbeat now checks if the server is alive.
affected #: 1 file (71 bytes)
--- a/yt/gui/reason/extdirect_repl.py Wed Apr 06 22:01:53 2011 -0400
+++ b/yt/gui/reason/extdirect_repl.py Wed Apr 06 23:12:33 2011 -0400
@@ -150,6 +150,10 @@
return self.payload_handler.deliver_payloads()
def _check_heartbeat(self):
+ if self.server is not None:
+ if not all((s._monitor.is_alive() for s in self.server.values())):
+ self.shutdown()
+ return
if time.time() - self.last_heartbeat > self.timeout:
print "Shutting down after a timeout of %s" % (self.timeout)
#sys.exit(0)
@@ -157,9 +161,7 @@
# server instance by default.
self.shutdown()
return
- print "Not shutting down from timeout."
- self._heartbeat_timer = threading.Timer(self.timeout - 60,
- self._check_heartbeat)
+ self._heartbeat_timer = threading.Timer(10, self._check_heartbeat)
self._heartbeat_timer.start()
def shutdown(self):
http://bitbucket.org/yt_analysis/yt/changeset/277dd5765798/
changeset: r4103:277dd5765798
branch: yt
user: MatthewTurk
date: 2011-04-12 16:32:38
summary: Merge
affected #: 2 files (272 bytes)
--- a/yt/analysis_modules/halo_finding/halo_objects.py Wed Apr 06 23:12:33 2011 -0400
+++ b/yt/analysis_modules/halo_finding/halo_objects.py Tue Apr 12 10:32:38 2011 -0400
@@ -856,7 +856,7 @@
# First get the list of fields from the first file. Not all fields
# are saved all the time (e.g. creation_time, particle_type).
mylog.info("Getting field %s from hdf5 halo particle files." % field)
- f = h5py.File(fnames[0])
+ f = h5py.File(fnames[0], 'r')
fields = f["Halo%08d" % halo].keys()
# If we dont have this field, we can give up right now.
if field not in fields: return None
@@ -866,14 +866,19 @@
else:
field_data = na.empty(size, dtype='float64')
f.close()
+ # Apparently, there's a bug in h5py that was keeping the file pointer
+ # f closed, even though it's re-opened below. This del seems to fix
+ # that.
+ del f
offset = 0
for fname in fnames:
- f = h5py.File(fname)
+ f = h5py.File(fname, 'r')
this = f["Halo%08d" % halo][field][:]
s = this.size
field_data[offset:offset+s] = this
offset += s
f.close()
+ del f
return field_data
def center_of_mass(self):
--- a/yt/utilities/setup.py Wed Apr 06 23:12:33 2011 -0400
+++ b/yt/utilities/setup.py Tue Apr 12 10:32:38 2011 -0400
@@ -147,6 +147,7 @@
config.add_subpackage("answer_testing")
config.add_subpackage("delaunay") # From SciPy, written by Robert Kern
config.add_subpackage("kdtree")
+ config.add_data_files(('kdtree', ['kdtree/fKDpy.so',]))
config.add_subpackage("parallel_tools")
config.add_extension("data_point_utilities",
"yt/utilities/data_point_utilities.c", libraries=["m"])
Repository URL: https://bitbucket.org/yt_analysis/yt/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
More information about the yt-svn
mailing list