CDAT / jupyter-vcdat

A Jupyter Lab extension based on vCDAT.
BSD 3-Clause "New" or "Revised" License
6 stars 5 forks source link

Var inject update #117

Closed downiec closed 5 years ago

downiec commented 5 years ago

This update allows user to edit derived variables (issue #103 ). Along with that feature, this changes the way variables are loaded/injected into the notebook. For user created variables (not loaded from file), adds some functionality that will inject the appropriate code for updating a variable that doesn't have a file associated with it. Also when variables are loaded from file, the file is opened and the closed all in the same command. The data_readers and related functions have been removed. Modified the VariableTracker to improve readability and reduce complexity by consolidating some data structures and removing several unnecessary functions. Searched through code to check for unnecessary functions/props and variables to further clean up code. Also refactored/updated the python commands located in the constants.ts file, so that variables that are used in the back-end kernel commands don't conflict with variable names that the user might use.

doutriaux1 commented 5 years ago

@downiec whe i started it the first time, I had an "untitled.ipynb" opened (from previous session). When I closed it it I got a pop up that said:

Error
Cannot read property 'widgets' of null
doutriaux1 commented 5 years ago

@downiec I was able to open and plot one of Ken's DRS files! The second time around (loading more files) I got this meesage:

Command Error
Code resulted in errors. Error name: SyntaxError. Message: invalid syntax (<ipython-input-8-2aebe5991d50>, line 2).
doutriaux1 commented 5 years ago

@downiec I'm 99% sure it's because the variable name contains a % in it. If that's the case let's not worry about it, but we might want to catch these weird character and replace them for the user.

doutriaux1 commented 5 years ago

@downiec yes i can confirm it is because of weird character. Since we can rename in master let's not worry about it.