Git Product home page Git Product logo

Comments (29)

ly29 avatar ly29 commented on June 3, 2024 2

angry

from sverchok.

ly29 avatar ly29 commented on June 3, 2024 1

error
The formatting might need some work and I consider writing to a text file and std err as well

from sverchok.

ly29 avatar ly29 commented on June 3, 2024 1

error2

from sverchok.

ly29 avatar ly29 commented on June 3, 2024

Absolutely, even worse are nodes that hides the error so there is nothing going red at all.

from sverchok.

ly29 avatar ly29 commented on June 3, 2024

The options seem to come down to:

  • External log file, slightly better than console, open relevant part in blender text editor on error
  • Pipe directly into blender text buffer
  • Draw some text in the node editor

They all have their drawbacks and upside, they are not exclusive. A sensible first step would be to start using the logger module.

from sverchok.

portnov avatar portnov commented on June 3, 2024

I think the most common errors are somehow related to "invalid input": wrong type of data in connected sockets, or unconnected sockets that must be connected for node to function, or invalid amount or "shape" of data. These types of errors i think could be indicated on the node itself. For example mark socket red if it is required to connect it.

from sverchok.

ly29 avatar ly29 commented on June 3, 2024

Also now I have prepared for higher amount of pre testing, also with the Required[0] default for node function.
Some nodes might have more advanced needs of socket than on off so raising and error could also be allowed.

[0] Nothing is done with this info yet...

from sverchok.

ly29 avatar ly29 commented on June 3, 2024

Yes, that as well, like they should turn yellow if they are missing data today, but today many nodes check themselves and quit quietly...

Agreed on red socket, and as well marking the node/s yellow to show which ones to inspect.

from sverchok.

zeffii avatar zeffii commented on June 3, 2024

time to employ the logging module.

from sverchok.

portnov avatar portnov commented on June 3, 2024

Can we use stethoscope-like drawing to display errors?

from sverchok.

ly29 avatar ly29 commented on June 3, 2024

Potentially yes.

from sverchok.

ly29 avatar ly29 commented on June 3, 2024

@portnov
Something like this I guess you mean

from sverchok.

ly29 avatar ly29 commented on June 3, 2024

Some settings for this could be in the debug panel.

from sverchok.

ly29 avatar ly29 commented on June 3, 2024

Did some tweaking but will let further developments be based on further feedback

  • print to stdout, should be stderr
  • dumps error message to text file NodeTree_Error in blender text editor
  • draws it using blf

from sverchok.

ly29 avatar ly29 commented on June 3, 2024

We could also show documentation with the same infrastructure.

from sverchok.

portnov avatar portnov commented on June 3, 2024

full stacktraces in node editor are not very useful imho. Can we draw just short error message there, and print full stack to text buffer?

from sverchok.

ly29 avatar ly29 commented on June 3, 2024

A limit it to the last two lines in editor right now which gives file and error. Full trace in console and text editor.
Try and test

from sverchok.

zeffii avatar zeffii commented on June 3, 2024

i'm really really liking this.

from sverchok.

zeffii avatar zeffii commented on June 3, 2024

now.. if f8 worked ... holy smokes.

from sverchok.

ly29 avatar ly29 commented on June 3, 2024

Yeah, it is getting embarrassing. Trying to sort it out now.

from sverchok.

ly29 avatar ly29 commented on June 3, 2024

Okay so now I am starting to get a bit worried...
What happens is that the types in

If a module imports objects from another module using from ... import ..., calling reload() for the other module does not redefine the objects imported from it — one way around this is to re-execute the from
statement, another is to use import and qualified names (module.name) instead.

from sverchok.

ly29 avatar ly29 commented on June 3, 2024

So it works now, somewhat.
Doesn't result in a lot red nodes at least.

from sverchok.

ly29 avatar ly29 commented on June 3, 2024

Nodes can be edited.

Caveats seem to be

  • no editing of the base classes, for that a restart is needed.

from sverchok.

zeffii avatar zeffii commented on June 3, 2024

i don't get why everything down from svrx can't simply be nixed.

from sverchok.

ly29 avatar ly29 commented on June 3, 2024

A brief illustration of the problem.

>>> import importlib
>>> import svrx
>>> x=svrx.typing.Vertices()
>>> t=svrx.typing.Vertices
>>> isinstance(x, t)
True
>>> importlib.reload(svrx.typing)
<module 'svrx.typing' from 'c:\\Program Files\\Blender Foundation\\Blender\\2.78\\scripts\\addons\\svrx\\typing.py'>
>>> isinstance(x, t)
True
>>> t=svrx.typing.Vertices
>>> isinstance(x, t)
False
>>> type(x)
<class 'svrx.typing.Vertices'>
>>> t
<class 'svrx.typing.Vertices'>

What fails is the issubclass/isinstance checks in the parsing of the node types. There where 2-3 other problems of the same kind but they where easily resolvable.

from sverchok.

ly29 avatar ly29 commented on June 3, 2024

@zeffii
I am thinking about nice ways to resolve this, but F8/reload is a bit of a hack in python.

from sverchok.

zeffii avatar zeffii commented on June 3, 2024

it's weird isn't it. that's the thing that messes with most newcomers heads. as soon as a program starts to get complex... the imports tend to become tricky to deal with (until heavy persistence makes them understood).

from sverchok.

zeffii avatar zeffii commented on June 3, 2024

it's almost like quantum physics. " if you think you understand quantum physics, you don't understand quantum physics" . almost.

from sverchok.

ly29 avatar ly29 commented on June 3, 2024

I am down to three modules that can't be reloaded.

from sverchok.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.