1 | *************************************************************************** |
---|
2 | |
---|
3 | IPython post-mortem report |
---|
4 | |
---|
5 | {'commit_hash': u'814d26c', |
---|
6 | 'commit_source': 'installation', |
---|
7 | 'default_encoding': 'UTF-8', |
---|
8 | 'ipython_path': '/Applications/sage/sage-git/local/lib/python2.7/site-packages/IPython', |
---|
9 | 'ipython_version': '5.0.0', |
---|
10 | 'os_name': 'posix', |
---|
11 | 'platform': 'Darwin-15.6.0-x86_64-i386-64bit', |
---|
12 | 'sys_executable': '/Applications/sage/sage-git/local/bin/python', |
---|
13 | 'sys_platform': 'darwin', |
---|
14 | 'sys_version': '2.7.10 (default, Oct 17 2016, 19:18:40) \n[GCC 4.9.3]'} |
---|
15 | |
---|
16 | *************************************************************************** |
---|
17 | |
---|
18 | |
---|
19 | |
---|
20 | *************************************************************************** |
---|
21 | |
---|
22 | Crash traceback: |
---|
23 | |
---|
24 | --------------------------------------------------------------------------- |
---|
25 | --------------------------------------------------------------------------- |
---|
26 | OSError Python 2.7.10: /Applications/sage/sage-git/local/bin/python |
---|
27 | Fri Oct 21 14:55:42 2016 |
---|
28 | A problem occurred executing Python code. Here is the sequence of function |
---|
29 | calls leading up to the error, with the most recent (innermost) call last. |
---|
30 | /Applications/sage/sage-git/src/bin/sage-ipython in <module>() |
---|
31 | 1 #!/usr/bin/env python |
---|
32 | 2 # -*- coding: utf-8 -*- |
---|
33 | 3 """ |
---|
34 | 4 Sage IPython startup script. |
---|
35 | 5 """ |
---|
36 | 6 |
---|
37 | 7 from sage.repl.interpreter import SageTerminalApp |
---|
38 | 8 |
---|
39 | 9 app = SageTerminalApp.instance() |
---|
40 | 10 app.initialize() |
---|
41 | ---> 11 app.start() |
---|
42 | global app.start = <bound method SageTerminalApp.start of <sage.repl.interpreter.SageTerminalApp object at 0x1016b1c10>> |
---|
43 | |
---|
44 | /Applications/sage/sage-git/local/lib/python2.7/site-packages/IPython/terminal/ipapp.pyc in start(self=<sage.repl.interpreter.SageTerminalApp object>) |
---|
45 | 333 if self.log_level <= logging.INFO: print() |
---|
46 | 334 |
---|
47 | 335 def _pylab_changed(self, name, old, new): |
---|
48 | 336 """Replace --pylab='inline' with --pylab='auto'""" |
---|
49 | 337 if new == 'inline': |
---|
50 | 338 warnings.warn("'inline' not available as pylab backend, " |
---|
51 | 339 "using 'auto' instead.") |
---|
52 | 340 self.pylab = 'auto' |
---|
53 | 341 |
---|
54 | 342 def start(self): |
---|
55 | 343 if self.subapp is not None: |
---|
56 | 344 return self.subapp.start() |
---|
57 | 345 # perform any prexec steps: |
---|
58 | 346 if self.interact: |
---|
59 | 347 self.log.debug("Starting IPython's mainloop...") |
---|
60 | --> 348 self.shell.mainloop() |
---|
61 | self.shell.mainloop = <bound method SageTerminalInteractiveShell.mainloop of <sage.repl.interpreter.SageTerminalInteractiveShell object at 0x1027c8b10>> |
---|
62 | 349 else: |
---|
63 | 350 self.log.debug("IPython not interactive...") |
---|
64 | 351 |
---|
65 | 352 def load_default_config(ipython_dir=None): |
---|
66 | 353 """Load the default config file from the default ipython_dir. |
---|
67 | 354 |
---|
68 | 355 This is useful for embedded shells. |
---|
69 | 356 """ |
---|
70 | 357 if ipython_dir is None: |
---|
71 | 358 ipython_dir = get_ipython_dir() |
---|
72 | 359 |
---|
73 | 360 profile_dir = os.path.join(ipython_dir, 'profile_default') |
---|
74 | 361 |
---|
75 | 362 config = Config() |
---|
76 | 363 for cf in Application._load_config_files("ipython_config", path=profile_dir): |
---|
77 | |
---|
78 | /Applications/sage/sage-git/local/lib/python2.7/site-packages/IPython/terminal/interactiveshell.pyc in mainloop(self=<sage.repl.interpreter.SageTerminalInteractiveShell object>, display_banner=<object object>) |
---|
79 | 387 if (not self.confirm_exit) \ |
---|
80 | 388 or self.ask_yes_no('Do you really want to exit ([y]/n)?','y','n'): |
---|
81 | 389 self.ask_exit() |
---|
82 | 390 |
---|
83 | 391 else: |
---|
84 | 392 if code: |
---|
85 | 393 self.run_cell(code, store_history=True) |
---|
86 | 394 |
---|
87 | 395 def mainloop(self, display_banner=DISPLAY_BANNER_DEPRECATED): |
---|
88 | 396 # An extra layer of protection in case someone mashing Ctrl-C breaks |
---|
89 | 397 # out of our internal code. |
---|
90 | 398 if display_banner is not DISPLAY_BANNER_DEPRECATED: |
---|
91 | 399 warn('mainloop `display_banner` argument is deprecated since IPython 5.0. Call `show_banner()` if needed.', DeprecationWarning, stacklevel=2) |
---|
92 | 400 while True: |
---|
93 | 401 try: |
---|
94 | --> 402 self.interact() |
---|
95 | self.interact = <bound method SageTerminalInteractiveShell.interact of <sage.repl.interpreter.SageTerminalInteractiveShell object at 0x1027c8b10>> |
---|
96 | 403 break |
---|
97 | 404 except KeyboardInterrupt: |
---|
98 | 405 print("\nKeyboardInterrupt escaped interact()\n") |
---|
99 | 406 |
---|
100 | 407 if hasattr(self, '_eventloop'): |
---|
101 | 408 self._eventloop.close() |
---|
102 | 409 |
---|
103 | 410 _inputhook = None |
---|
104 | 411 def inputhook(self, context): |
---|
105 | 412 if self._inputhook is not None: |
---|
106 | 413 self._inputhook(context) |
---|
107 | 414 |
---|
108 | 415 def enable_gui(self, gui=None): |
---|
109 | 416 if gui: |
---|
110 | 417 self._inputhook = get_inputhook_func(gui) |
---|
111 | |
---|
112 | /Applications/sage/sage-git/local/lib/python2.7/site-packages/IPython/terminal/interactiveshell.pyc in interact(self=<sage.repl.interpreter.SageTerminalInteractiveShell object>, display_banner=<object object>) |
---|
113 | 370 |
---|
114 | 371 def pre_prompt(self): |
---|
115 | 372 if self.rl_next_input: |
---|
116 | 373 self.pt_cli.application.buffer.text = cast_unicode_py2(self.rl_next_input) |
---|
117 | 374 self.rl_next_input = None |
---|
118 | 375 |
---|
119 | 376 def interact(self, display_banner=DISPLAY_BANNER_DEPRECATED): |
---|
120 | 377 |
---|
121 | 378 if display_banner is not DISPLAY_BANNER_DEPRECATED: |
---|
122 | 379 warn('interact `display_banner` argument is deprecated since IPython 5.0. Call `show_banner()` if needed.', DeprecationWarning, stacklevel=2) |
---|
123 | 380 |
---|
124 | 381 while self.keep_running: |
---|
125 | 382 print(self.separate_in, end='') |
---|
126 | 383 |
---|
127 | 384 try: |
---|
128 | --> 385 code = self.prompt_for_code() |
---|
129 | code = u'test_conjecture_on_matrix(DBA._B)' |
---|
130 | self.prompt_for_code = <bound method SageTerminalInteractiveShell.prompt_for_code of <sage.repl.interpreter.SageTerminalInteractiveShell object at 0x1027c8b10>> |
---|
131 | 386 except EOFError: |
---|
132 | 387 if (not self.confirm_exit) \ |
---|
133 | 388 or self.ask_yes_no('Do you really want to exit ([y]/n)?','y','n'): |
---|
134 | 389 self.ask_exit() |
---|
135 | 390 |
---|
136 | 391 else: |
---|
137 | 392 if code: |
---|
138 | 393 self.run_cell(code, store_history=True) |
---|
139 | 394 |
---|
140 | 395 def mainloop(self, display_banner=DISPLAY_BANNER_DEPRECATED): |
---|
141 | 396 # An extra layer of protection in case someone mashing Ctrl-C breaks |
---|
142 | 397 # out of our internal code. |
---|
143 | 398 if display_banner is not DISPLAY_BANNER_DEPRECATED: |
---|
144 | 399 warn('mainloop `display_banner` argument is deprecated since IPython 5.0. Call `show_banner()` if needed.', DeprecationWarning, stacklevel=2) |
---|
145 | 400 while True: |
---|
146 | |
---|
147 | /Applications/sage/sage-git/local/lib/python2.7/site-packages/IPython/terminal/interactiveshell.pyc in prompt_for_code(self=<sage.repl.interpreter.SageTerminalInteractiveShell object>) |
---|
148 | 306 processor=HighlightMatchingBracketProcessor(chars='[](){}'), |
---|
149 | 307 filter=HasFocus(DEFAULT_BUFFER) & ~IsDone() & |
---|
150 | 308 Condition(lambda cli: self.highlight_matching_brackets))], |
---|
151 | 309 } |
---|
152 | 310 |
---|
153 | 311 def _update_layout(self): |
---|
154 | 312 """ |
---|
155 | 313 Ask for a re computation of the application layout, if for example , |
---|
156 | 314 some configuration options have changed. |
---|
157 | 315 """ |
---|
158 | 316 if self._pt_app: |
---|
159 | 317 self._pt_app.layout = create_prompt_layout(**self._layout_options()) |
---|
160 | 318 |
---|
161 | 319 def prompt_for_code(self): |
---|
162 | 320 document = self.pt_cli.run( |
---|
163 | --> 321 pre_run=self.pre_prompt, reset_current_buffer=True) |
---|
164 | global pre_run = undefined |
---|
165 | self.pre_prompt = <bound method SageTerminalInteractiveShell.pre_prompt of <sage.repl.interpreter.SageTerminalInteractiveShell object at 0x1027c8b10>> |
---|
166 | global reset_current_buffer = undefined |
---|
167 | global True = undefined |
---|
168 | 322 return document.text |
---|
169 | 323 |
---|
170 | 324 def init_io(self): |
---|
171 | 325 if sys.platform not in {'win32', 'cli'}: |
---|
172 | 326 return |
---|
173 | 327 |
---|
174 | 328 import win_unicode_console |
---|
175 | 329 import colorama |
---|
176 | 330 |
---|
177 | 331 win_unicode_console.enable() |
---|
178 | 332 colorama.init() |
---|
179 | 333 |
---|
180 | 334 # For some reason we make these wrappers around stdout/stderr. |
---|
181 | 335 # For now, we need to reset them so all output gets coloured. |
---|
182 | 336 # https://github.com/ipython/ipython/issues/8669 |
---|
183 | |
---|
184 | /Applications/sage/sage-git/local/lib/python2.7/site-packages/prompt_toolkit/interface.pyc in run(self=<prompt_toolkit.interface.CommandLineInterface object>, reset_current_buffer=True, pre_run=<bound method SageTerminalInteractiveShell.pre_p...interpreter.SageTerminalInteractiveShell object>>) |
---|
185 | 374 try: |
---|
186 | 375 self._is_running = True |
---|
187 | 376 |
---|
188 | 377 self.on_start.fire() |
---|
189 | 378 self.reset(reset_current_buffer=reset_current_buffer) |
---|
190 | 379 |
---|
191 | 380 # Call pre_run. |
---|
192 | 381 if pre_run: |
---|
193 | 382 pre_run() |
---|
194 | 383 |
---|
195 | 384 # Run eventloop in raw mode. |
---|
196 | 385 with self.input.raw_mode(): |
---|
197 | 386 self.renderer.request_absolute_cursor_position() |
---|
198 | 387 self._redraw() |
---|
199 | 388 |
---|
200 | --> 389 self.eventloop.run(self.input, self.create_eventloop_callbacks()) |
---|
201 | self.eventloop.run = <bound method PosixEventLoop.run of <prompt_toolkit.eventloop.posix.PosixEventLoop object at 0x102f00a10>> |
---|
202 | self.input = StdinInput(stdin=<open file '<stdin>', mode 'r' at 0x10156e0c0>) |
---|
203 | self.create_eventloop_callbacks = <bound method CommandLineInterface.create_eventloop_callbacks of <prompt_toolkit.interface.CommandLineInterface object at 0x102f0a950>> |
---|
204 | 390 finally: |
---|
205 | 391 # Clean up renderer. (This will leave the alternate screen, if we use |
---|
206 | 392 # that.) |
---|
207 | 393 |
---|
208 | 394 # If exit/abort haven't been called set, but another exception was |
---|
209 | 395 # thrown instead for some reason, make sure that we redraw in exit |
---|
210 | 396 # mode. |
---|
211 | 397 if not self.is_done: |
---|
212 | 398 self._exit_flag = True |
---|
213 | 399 self._redraw() |
---|
214 | 400 |
---|
215 | 401 self.renderer.reset() |
---|
216 | 402 self.on_stop.fire() |
---|
217 | 403 self._is_running = False |
---|
218 | 404 |
---|
219 | |
---|
220 | /Applications/sage/sage-git/local/lib/python2.7/site-packages/prompt_toolkit/eventloop/posix.pyc in run(self=<prompt_toolkit.eventloop.posix.PosixEventLoop object>, stdin=StdinInput(stdin=<open file '<stdin>', mode 'r' at 0x10156e0c0>), callbacks=<prompt_toolkit.interface._InterfaceEventLoopCallbacks object>) |
---|
221 | 87 # Quit when the input stream was closed. |
---|
222 | 88 if stdin_reader.closed: |
---|
223 | 89 self.stop() |
---|
224 | 90 |
---|
225 | 91 self.add_reader(stdin, read_from_stdin) |
---|
226 | 92 self.add_reader(self._schedule_pipe[0], None) |
---|
227 | 93 |
---|
228 | 94 with ctx: |
---|
229 | 95 while self._running: |
---|
230 | 96 # Call inputhook. |
---|
231 | 97 with TimeIt() as inputhook_timer: |
---|
232 | 98 if self._inputhook_context: |
---|
233 | 99 def ready(wait): |
---|
234 | 100 " True when there is input ready. The inputhook should return control. " |
---|
235 | 101 return self._ready_for_reading(current_timeout[0] if wait else 0) != [] |
---|
236 | --> 102 self._inputhook_context.call_inputhook(ready) |
---|
237 | self._inputhook_context.call_inputhook = <bound method InputHookContext.call_inputhook of <prompt_toolkit.eventloop.inputhook.InputHookContext object at 0x102f00e90>> |
---|
238 | ready = <function ready at 0x1975785f0> |
---|
239 | 103 |
---|
240 | 104 # Calculate remaining timeout. (The inputhook consumed some of the time.) |
---|
241 | 105 if current_timeout[0] is None: |
---|
242 | 106 remaining_timeout = None |
---|
243 | 107 else: |
---|
244 | 108 remaining_timeout = max(0, current_timeout[0] - inputhook_timer.duration) |
---|
245 | 109 |
---|
246 | 110 # Wait until input is ready. |
---|
247 | 111 fds = self._ready_for_reading(remaining_timeout) |
---|
248 | 112 |
---|
249 | 113 # When any of the FDs are ready. Call the appropriate callback. |
---|
250 | 114 if fds: |
---|
251 | 115 # Create lists of high/low priority tasks. The main reason |
---|
252 | 116 # for this is to allow painting the UI to happen as soon as |
---|
253 | 117 # possible, but when there are many events happening, we |
---|
254 | |
---|
255 | /Applications/sage/sage-git/local/lib/python2.7/site-packages/prompt_toolkit/eventloop/inputhook.pyc in call_inputhook(self=<prompt_toolkit.eventloop.inputhook.InputHookContext object>, input_is_ready_func=<function ready>) |
---|
256 | 57 |
---|
257 | 58 def call_inputhook(self, input_is_ready_func): |
---|
258 | 59 """ |
---|
259 | 60 Call the inputhook. (Called by a prompt-toolkit eventloop.) |
---|
260 | 61 """ |
---|
261 | 62 self._input_is_ready = input_is_ready_func |
---|
262 | 63 |
---|
263 | 64 # Start thread that activates this pipe when there is input to process. |
---|
264 | 65 def thread(): |
---|
265 | 66 input_is_ready_func(wait=True) |
---|
266 | 67 os.write(self._w, b'x') |
---|
267 | 68 |
---|
268 | 69 threading.Thread(target=thread).start() |
---|
269 | 70 |
---|
270 | 71 # Call inputhook. |
---|
271 | ---> 72 self.inputhook(self) |
---|
272 | self.inputhook = <bound method SageTerminalInteractiveShell.inputhook of <sage.repl.interpreter.SageTerminalInteractiveShell object at 0x1027c8b10>> |
---|
273 | self = <prompt_toolkit.eventloop.inputhook.InputHookContext object at 0x102f00e90> |
---|
274 | 73 |
---|
275 | 74 # Flush the read end of the pipe. |
---|
276 | 75 try: |
---|
277 | 76 os.read(self._r, 1024) |
---|
278 | 77 except OSError: |
---|
279 | 78 # This happens when the window resizes and a SIGWINCH was received. |
---|
280 | 79 # We get 'Error: [Errno 4] Interrupted system call' |
---|
281 | 80 # Just ignore. |
---|
282 | 81 pass |
---|
283 | 82 self._input_is_ready = None |
---|
284 | 83 |
---|
285 | 84 def close(self): |
---|
286 | 85 """ |
---|
287 | 86 Clean up resources. |
---|
288 | 87 """ |
---|
289 | |
---|
290 | /Applications/sage/sage-git/local/lib/python2.7/site-packages/IPython/terminal/interactiveshell.pyc in inputhook(self=<sage.repl.interpreter.SageTerminalInteractiveShell object>, context=<prompt_toolkit.eventloop.inputhook.InputHookContext object>) |
---|
291 | 398 if display_banner is not DISPLAY_BANNER_DEPRECATED: |
---|
292 | 399 warn('mainloop `display_banner` argument is deprecated since IPython 5.0. Call `show_banner()` if needed.', DeprecationWarning, stacklevel=2) |
---|
293 | 400 while True: |
---|
294 | 401 try: |
---|
295 | 402 self.interact() |
---|
296 | 403 break |
---|
297 | 404 except KeyboardInterrupt: |
---|
298 | 405 print("\nKeyboardInterrupt escaped interact()\n") |
---|
299 | 406 |
---|
300 | 407 if hasattr(self, '_eventloop'): |
---|
301 | 408 self._eventloop.close() |
---|
302 | 409 |
---|
303 | 410 _inputhook = None |
---|
304 | 411 def inputhook(self, context): |
---|
305 | 412 if self._inputhook is not None: |
---|
306 | --> 413 self._inputhook(context) |
---|
307 | self._inputhook = <function sage_inputhook at 0x193994320> |
---|
308 | context = <prompt_toolkit.eventloop.inputhook.InputHookContext object at 0x102f00e90> |
---|
309 | 414 |
---|
310 | 415 def enable_gui(self, gui=None): |
---|
311 | 416 if gui: |
---|
312 | 417 self._inputhook = get_inputhook_func(gui) |
---|
313 | 418 else: |
---|
314 | 419 self._inputhook = None |
---|
315 | 420 |
---|
316 | 421 # Run !system commands directly, not through pipes, so terminal programs |
---|
317 | 422 # work correctly. |
---|
318 | 423 system = InteractiveShell.system_raw |
---|
319 | 424 |
---|
320 | 425 def auto_rewrite_input(self, cmd): |
---|
321 | 426 """Overridden from the parent class to use fancy rewriting prompt""" |
---|
322 | 427 if not self.show_rewritten_input: |
---|
323 | 428 return |
---|
324 | |
---|
325 | /Applications/sage/sage-git/local/lib/python2.7/site-packages/sage/repl/inputhook.pyc in sage_inputhook(context=<prompt_toolkit.eventloop.inputhook.InputHookContext object>) |
---|
326 | 19 import select |
---|
327 | 20 import errno |
---|
328 | 21 |
---|
329 | 22 from IPython import get_ipython |
---|
330 | 23 from IPython.terminal.pt_inputhooks import register |
---|
331 | 24 |
---|
332 | 25 import sage.repl.attach |
---|
333 | 26 |
---|
334 | 27 |
---|
335 | 28 TIMEOUT = 0.25 # seconds |
---|
336 | 29 |
---|
337 | 30 |
---|
338 | 31 def sage_inputhook(context): |
---|
339 | 32 f = context.fileno() |
---|
340 | 33 while True: |
---|
341 | ---> 34 sage.repl.attach.reload_attached_files_if_modified() |
---|
342 | global sage.repl.attach.reload_attached_files_if_modified = <function reload_attached_files_if_modified at 0x1939667d0> |
---|
343 | 35 try: |
---|
344 | 36 r, w, e = select.select([f], [], [], TIMEOUT) |
---|
345 | 37 if f in r: |
---|
346 | 38 return # IPython signalled us to stop |
---|
347 | 39 except select.error as e: |
---|
348 | 40 if e[0] != errno.EINTR: |
---|
349 | 41 raise |
---|
350 | 42 |
---|
351 | 43 |
---|
352 | 44 register('sage', sage_inputhook) |
---|
353 | 45 |
---|
354 | 46 |
---|
355 | 47 def install(): |
---|
356 | 48 """ |
---|
357 | 49 Install the Sage input hook |
---|
358 | |
---|
359 | /Applications/sage/sage-git/local/lib/python2.7/site-packages/sage/repl/attach.pyc in reload_attached_files_if_modified() |
---|
360 | 572 where the automatic reload is triggered. So we have to do it |
---|
361 | 573 manually:: |
---|
362 | 574 |
---|
363 | 575 sage: shell.run_cell('from sage.repl.attach import reload_attached_files_if_modified') |
---|
364 | 576 sage: shell.run_cell('reload_attached_files_if_modified()') |
---|
365 | 577 ### reloading attached file tmp_....py modified at ... ### |
---|
366 | 578 |
---|
367 | 579 sage: shell.run_cell('a') |
---|
368 | 580 3 |
---|
369 | 581 sage: shell.run_cell('detach({0})'.format(repr(tmp))) |
---|
370 | 582 sage: shell.run_cell('attached_files()') |
---|
371 | 583 [] |
---|
372 | 584 sage: shell.quit() |
---|
373 | 585 """ |
---|
374 | 586 ip = get_ipython() |
---|
375 | --> 587 for filename, mtime in modified_file_iterator(): |
---|
376 | filename = undefined |
---|
377 | mtime = undefined |
---|
378 | global modified_file_iterator = <function modified_file_iterator at 0x1939662a8> |
---|
379 | 588 basename = os.path.basename(filename) |
---|
380 | 589 timestr = time.strftime('%T', mtime) |
---|
381 | 590 notice = '### reloading attached file {0} modified at {1} ###'.format(basename, timestr) |
---|
382 | 591 if ip and ip.pt_cli: |
---|
383 | 592 with ip.pt_cli.patch_stdout_context(): |
---|
384 | 593 print(notice) |
---|
385 | 594 code = load_wrap(filename, attach=True) |
---|
386 | 595 ip.run_cell(code) |
---|
387 | 596 elif ip: |
---|
388 | 597 print(notice) |
---|
389 | 598 code = load_wrap(filename, attach=True) |
---|
390 | 599 ip.run_cell(code) |
---|
391 | 600 else: |
---|
392 | 601 print(notice) |
---|
393 | 602 load(filename, globals(), attach=True) |
---|
394 | |
---|
395 | /Applications/sage/sage-git/local/lib/python2.7/site-packages/sage/repl/attach.pyc in modified_file_iterator() |
---|
396 | 520 sage: list(modified_file_iterator()) |
---|
397 | 521 [] |
---|
398 | 522 sage: sleep(1) # filesystem mtime granularity |
---|
399 | 523 sage: open(t, 'w').write('1') |
---|
400 | 524 sage: list(modified_file_iterator()) |
---|
401 | 525 [('/.../tmp_....py', time.struct_time(...))] |
---|
402 | 526 """ |
---|
403 | 527 global attached |
---|
404 | 528 modified = dict() |
---|
405 | 529 for filename in attached.keys(): |
---|
406 | 530 old_tm = attached[filename] |
---|
407 | 531 if not os.path.exists(filename): |
---|
408 | 532 print('### detaching file {0} because it does not exist (deleted?) ###'.format(filename)) |
---|
409 | 533 detach(filename) |
---|
410 | 534 continue |
---|
411 | --> 535 new_tm = os.path.getmtime(filename) |
---|
412 | new_tm = undefined |
---|
413 | global os.path.getmtime = <function getmtime at 0x1015d8140> |
---|
414 | filename = '/Users/dylanrupel/.sage/level_zero/double_bruhat_algebra.py' |
---|
415 | 536 if new_tm > old_tm: |
---|
416 | 537 modified[filename] = new_tm |
---|
417 | 538 |
---|
418 | 539 if not modified: |
---|
419 | 540 return |
---|
420 | 541 time.sleep(0.1) # sleep 100ms to give the editor time to finish saving |
---|
421 | 542 |
---|
422 | 543 for filename in modified.keys(): |
---|
423 | 544 old_tm = modified[filename] |
---|
424 | 545 new_tm = os.path.getmtime(filename) |
---|
425 | 546 if new_tm == old_tm: |
---|
426 | 547 # file was modified but did not change in the last 100ms |
---|
427 | 548 attached[filename] = new_tm |
---|
428 | 549 yield filename, time.gmtime(new_tm) |
---|
429 | 550 |
---|
430 | |
---|
431 | /Applications/sage/sage-git/local/lib/python/genericpath.pyc in getmtime(filename='/Users/dylanrupel/.sage/level_zero/double_bruhat_algebra.py') |
---|
432 | 47 """Return true if the pathname refers to an existing directory.""" |
---|
433 | 48 try: |
---|
434 | 49 st = os.stat(s) |
---|
435 | 50 except os.error: |
---|
436 | 51 return False |
---|
437 | 52 return stat.S_ISDIR(st.st_mode) |
---|
438 | 53 |
---|
439 | 54 |
---|
440 | 55 def getsize(filename): |
---|
441 | 56 """Return the size of a file, reported by os.stat().""" |
---|
442 | 57 return os.stat(filename).st_size |
---|
443 | 58 |
---|
444 | 59 |
---|
445 | 60 def getmtime(filename): |
---|
446 | 61 """Return the last modification time of a file, reported by os.stat().""" |
---|
447 | ---> 62 return os.stat(filename).st_mtime |
---|
448 | global os.stat = <built-in function stat> |
---|
449 | filename.st_mtime = undefined |
---|
450 | 63 |
---|
451 | 64 |
---|
452 | 65 def getatime(filename): |
---|
453 | 66 """Return the last access time of a file, reported by os.stat().""" |
---|
454 | 67 return os.stat(filename).st_atime |
---|
455 | 68 |
---|
456 | 69 |
---|
457 | 70 def getctime(filename): |
---|
458 | 71 """Return the metadata change time of a file, reported by os.stat().""" |
---|
459 | 72 return os.stat(filename).st_ctime |
---|
460 | 73 |
---|
461 | 74 |
---|
462 | 75 # Return the longest prefix of all list elements. |
---|
463 | 76 def commonprefix(m): |
---|
464 | 77 "Given a list of pathnames, returns the longest common leading component" |
---|
465 | |
---|
466 | OSError: [Errno 2] No such file or directory: '/Users/dylanrupel/.sage/level_zero/double_bruhat_algebra.py' |
---|
467 | |
---|
468 | *************************************************************************** |
---|
469 | |
---|
470 | History of session input:DBA = DoubleBruhatAlgebra(['B',Integer(4),Integer(1)])get_ipython().magic(u'attach double_bruhat_algebra.py')DBA = DoubleBruhatAlgebra(['B',Integer(4),Integer(1)])test_conjecture_on_matrix(DBA._B)(Integer(0), Integer(0), -Integer(1), Integer(2), Integer(0))La = DBA._RS.weight_space(extended = True).basis()wt = -La[Integer(2)]+Integer(2)*La[Integer(3)]DBA.path_graph(wt)test_conjecture_on_matrix(DBA._B)DBA = DoubleBruhatAlgebra(['B',Integer(4),Integer(1)])test_conjecture_on_matrix(DBA._B)DBA = DoubleBruhatAlgebra(['B',Integer(4),Integer(1)])test_conjecture_on_matrix(DBA._B)DBA = DoubleBruhatAlgebra(['B',Integer(4),Integer(1)])test_conjecture_on_matrix(DBA._B)DBA = DoubleBruhatAlgebra(['B',Integer(4),Integer(1)])test_conjecture_on_matrix(DBA._B)DBA = DoubleBruhatAlgebra(['B',Integer(4),Integer(1)])test_conjecture_on_matrix(DBA._B)DBA = DoubleBruhatAlgebra(['B',Integer(4),Integer(1)])test_conjecture_on_matrix(DBA._B)DBA = DoubleBruhatAlgebra(['B',Integer(4),Integer(1)])test_conjecture_on_matrix(DBA._B)DBA = DoubleBruhatAlgebra(['B',Integer(4),Integer(1)])test_conjecture_on_matrix(DBA._B)type((Integer(1),Integer(2)))type((Integer(1),Integer(2))) == 'tuple'type((Integer(1),Integer(2))) == <type 'tuple'>isinstance((Integer(1),Integer(2)), tuple)type((Integer(1),Integer(2))) == tupletype((Integer(1),Integer(2)))((Integer(3),Integer(2),-Integer(5)))type((Integer(1),Integer(2)))([Integer(3),Integer(2),-Integer(5)])type(_)DBA = DoubleBruhatAlgebra(['B',Integer(4),Integer(1)])test_conjecture_on_matrix(DBA._B)test_conjecture_on_matrix(DBA._B)wt = La[Integer(1)]-Integer(2)*La[Integer(2)]+Integer(2)*La[Integer(3)]V = crystals.LSPaths(wt)W = V.subcrystal(max_depth=Integer(7))DBA.path_graph(wt)DBA = DoubleBruhatAlgebra(['B',Integer(4),Integer(1)])test_conjecture_on_matrix(DBA._B)V = crystals.LSPaths(wt)W = V.subcrystal(max_depth=Integer(3))G = W.digraph()G.show(method='js',link_distance=Integer(100),vertex_labels=False, edge_labels=True,charge=-Integer(1000), vertex_partition=[W.module_generators])W = V.subcrystal(max_depth=Integer(5))G = W.digraph()G.show(method='js',link_distance=Integer(100),vertex_labels=False, edge_labels=True,charge=-Integer(1000), vertex_partition=[W.module_generators])W = V.subcrystal(max_depth=Integer(7))W = V.subcrystal(max_depth=Integer(6))G = W.digraph()G.show(method='js',link_distance=Integer(100),vertex_labels=False, edge_labels=True,charge=-Integer(1000), vertex_partition=[W.module_generators])exp(Integer(2))exp(matrix([[Integer(0),Integer(1),Integer(0)],[Integer(0),Integer(0),Integer(2)],[Integer(0),Integer(0),Integer(0)]]))exp(matrix([[Integer(0),Integer(0),Integer(0)],[Integer(1),Integer(0),Integer(0)],[Integer(0),Integer(2),Integer(0)]]))wt = La[Integer(1)]-Integer(2)*La[Integer(2)]+Integer(2)*La[Integer(3)]DBA = DoubleBruhatAlgebra(['C',Integer(2),Integer(1)])test_conjecture_on_matrix(DBA._B)DBA = DoubleBruhatAlgebra(['C',Integer(3),Integer(1)])test_conjecture_on_matrix(DBA._B)DBA = DoubleBruhatAlgebra(['C',Integer(5),Integer(1)])DBA = DoubleBruhatAlgebra(['C',Integer(5)])DBA = DoubleBruhatAlgebra(['C',Integer(5)])test_conjecture_on_matrix(DBA._B)DBA = DoubleBruhatAlgebra(['C',Integer(5)])test_conjecture_on_matrix(DBA._B)DBA = DoubleBruhatAlgebra(['C',Integer(5)])test_conjecture_on_matrix(DBA._B)exp(matrix([[Integer(0),Integer(1),Integer(0),Integer(0)],[Integer(0),Integer(0),Integer(2),Integer(0)],[Integer(0),Integer(0),Integer(0),Integer(3)],[Integer(0),Integer(0),Integer(0),Integer(0)]]))exp(matrix([[Integer(0),Integer(1),Integer(0),Integer(0),Integer(0)],[Integer(0),Integer(0),Integer(2),Integer(0),Integer(0)],[Integer(0),Integer(0),Integer(0),Integer(3),Integer(0)],[Integer(0),Integer(0),Integer(0),Integer(0),Integer(4)],[Integer(0),Integer(0),Integer(0),Integer(0),Integer(0)]]))DBA = DoubleBruhatAlgebra(['C',Integer(3)])test_conjecture_on_matrix(DBA._B)DBA = DoubleBruhatAlgebra(['C',Integer(4)])test_conjecture_on_matrix(DBA._B)DBA.path_graph((Integer(0), Integer(1), -Integer(2), Integer(1)))La = DBA._RS.weight_space().basis()wt = La[Integer(1)]-Integer(2)*La[Integer(2)]+La[Integer(3)]V = crystals.LSPaths(wt)W = V.subcrystal(max_depth=Integer(6))G = W.digraph()G.show(method='js',link_distance=Integer(100),vertex_labels=False, edge_labels=True,charge=-Integer(1000), vertex_partition=[W.module_generators])W = V.subcrystal(max_depth=Integer(20))G = W.digraph()G.show(method='js',link_distance=Integer(100),vertex_labels=False, edge_labels=True,charge=-Integer(1000), vertex_partition=[W.module_generators])DBA.path_graph((Integer(0), Integer(1), -Integer(2), Integer(1)))G.show(method='js',link_distance=Integer(100),vertex_labels=False, edge_labels=True,charge=-Integer(1000), vertex_partition=[DBA._crystal_weight_dict[W.module_generators[Integer(0)].weight()][W.module_generators[Integer(0)].weight()]])DBA = DoubleBruhatAlgebra(['G',Integer(2)])test_conjecture_on_matrix(DBA._B)La = DBA._RS.weight_space().basis()wt = -Integer(2)*La[Integer(0)]+Integer(3)*La[Integer(1)]V = crystals.LSPaths(wt)W = V.subcrystal(max_depth=Integer(20))G = W.digraph()G.show(method='js',link_distance=Integer(100),vertex_labels=False, edge_labels=True,charge=-Integer(1000), vertex_partition=[DBA._crystal_weight_dict[W.module_generators[Integer(0)].weight()][W.module_generators[Integer(0)].weight()]])G.path_graph((-Integer(2),Integer(3)))DBA.path_graph((-Integer(2),Integer(3)))G.show(method='js',link_distance=Integer(100),vertex_labels=False, edge_labels=True,charge=-Integer(1000), vertex_partition=[W.module_generators])DBA = DoubleBruhatAlgebra(['G',Integer(2)])test_conjecture_on_matrix(DBA._B)DBA = DoubleBruhatAlgebra(['G',Integer(2)])test_conjecture_on_matrix(DBA._B)DBA = DoubleBruhatAlgebra(['G',Integer(2)])test_conjecture_on_matrix(DBA._B) |
---|
471 | *** Last line of input (may not be in above history): |
---|
472 | test_conjecture_on_matrix(DBA._B) |
---|