Comments (8)
One more thing about this. If you have a syntax error in your code, when help(my_function)
is called by _get_doc
you get this same obscure error about the command not being available. The _get_doc
call is failing on the help
command but because there is a syntax error.
from oct2py.
Another good catch. I have the flu, so it may be a little while before I get to it.
from oct2py.
Sorry, hope you feel better.
I tried to figure it out but I wasn't sure what elif line == '\x15'
actually is checking for.
from oct2py.
I wrap the commands in a try/catch block in Octave. If all goes well,
Octave prints char(3), which is '\x03'. If an error is thrown, Octave
prints char(21), which is '\x15', which is what I am checking for in that
line. Basically, I need to rethink the way I check for the existence of a
function, and not require it to have a docstring.
On Wed, Dec 18, 2013 at 9:58 PM, Jason Moore [email protected]:
Sorry, hope you feel better.
I tried to figure it out but I wasn't sure what elif line == '\x15'actually is checking for.
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/32#issuecomment-30903507
.
from oct2py.
That logic is in Oct2Py.__getattr__
, which calls Oct2Py._get_doc
for
any unknown attribute lookup.
On Wed, Dec 18, 2013 at 10:10 PM, Steven Silvester <
[email protected]> wrote:
I wrap the commands in a try/catch block in Octave. If all goes well,
Octave prints char(3), which is '\x03'. If an error is thrown, Octave
prints char(21), which is '\x15', which is what I am checking for in that
line. Basically, I need to rethink the way I check for the existence of a
function, and not require it to have a docstring.On Wed, Dec 18, 2013 at 9:58 PM, Jason Moore [email protected]:
Sorry, hope you feel better.
I tried to figure it out but I wasn't sure what elif line == '\x15'actually is checking for.
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/32#issuecomment-30903507
.
from oct2py.
Here's what should happen now (in the dev
branch):
If the function exists and has a docstring, we use that. If it exists and does not have a docstring, we use a blurb about the function and the function declaration (assuming it is on the top line of the file). Example:
temp_oct2py_func is the user-defined function defined from: C:\Users\silvester\Documents\Python Scripts\temp_oct2py_func.m
function [outp] = temp_oct2py_func(inp)
If it does not exist, we raise an error similar to:
oct2py.utils.Oct2PyError: Function "temp3" does not exist on the Octave session path
Unfortunately, if the script has a syntax error, Octave closes the connection (but we raise an error with a notification). I cannot figure out how to avoid that behavior.
from oct2py.
Looks good.
Maybe on the closed connection error, you could suggest to the user to ensure the m file works from Octave.
from oct2py.
I'll add the line If using an m-file script, make sure it runs in Octave
to the error message. Also, I added the ability to use pexpect
on non-Windows platforms, which prevents Octave from closing the connection when there is a Syntax Error (since it registers as a tty connection). Thanks again!
from oct2py.
Related Issues (20)
- error: 'upfirdn' undefined near line 121, column 121 HOT 5
- Struct fieldnames that start with number are ignored HOT 1
- Bug: PULL-PUSH-PULL 1D Column vector will convert into 1D Row Vector HOT 4
- push will push Cell HOT 2
- [Question] Properly end session HOT 4
- Using `system ("cat ~/.octaverc")` on Winows HOT 2
- initialization: graphics_toolkit: 2004h toolkit is not available HOT 5
- Run doesn't create new variables in the octave environment HOT 3
- Conflict with opencv HOT 5
- bracketed paste \x1b[?2004h issue HOT 3
- Memory Leak HOT 1
- Problem with calling function; too many outputs HOT 1
- When I use python multiprocessing to open multiple octave displays a timeou HOT 1
- Problem with matlab package folders?
- Thread pool executor leaves ghost-threads that fill up memory
- Calling function script takes 1.5 seconds HOT 1
- error: 'graphics_toolkit' undefined
- Error trying to import octave in Anaconda Spyder using "from oct2py import octave" HOT 8
- _exist function not removing special characters from response HOT 2
- Error on testing
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from oct2py.