PyNode Next v2! #35
ehne
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
PyNode Next v2
Howdy folks! Today I'm pleased to announce PyNode Next version 2, which includes many updates:
Update today by downloading it at https://github.com/ehne/PyNode-Next/releases/latest
A New User Interface
As a part of the new version, we've updated the UI, making it cleaner and smaller, giving more room for your graph. The navigation bar has been squished into the top-left corner, whilst still retaining all the original functions.
We also added an alert for when you are running an older version of PyNode Next than the most recent version. This alert can be disabled by setting
check_for_new_versiontoFalse.Refactored Adding and Removing Nodes and Edges
At the core of PyNode Next is the ability to create nodes and edges. In the original version of PyNode, nodes could be added to the graph by either using strings as their ID's, or by adding them as an object.
The same went for adding edges, you could add them either by specifying the start and end nodes, or by adding an
Edgeobject.In PyNode Next v2, we have made it so that the object versions of the adding functions are now their own separate function (
graph.add()). This fixes a number of problems with v1.We also did the same with the removing functions (
graph.remove()):The reason for this change is that it allows for a few things:
Improved Error Reporting
With PyNode Next v2, and the removal of the overloading system, we have greatly improved the quality of Python's error reports. In v1, because the overloaded function's argument signature internally is
(*args, **kwargs), it would not tell you anything about missing arguments or incorrect types. Now with v2, the argument signature is correct to that specific function, and so should provide specific error messages.Improved Type Hinting and Editor Completion
Because of the aforementioned overloading signatures, PyNode Next v1's editor completion was woefully poor. But with the new version of PyNode Next removing the overloading system, your IDE should provide far more useful type hints as well as editor completions.
Legacy Arguments Are Gone
In keeping with the theme of improving developer experience, we have removed the legacy arguments.
The original PyNode had several arguments that are there for features that only exist in the old version. But to retain backwards compatibility, we kept them there. Unfortunately, this meant that there would be weird times when you'd write some code, expecting one thing, but something else would happen. Notably, the
set_label_stylemethod:Today, we've fixed that issue by getting rid of all legacy arguments:
outlineis gone fromedge.set_weight_style,node.set_label_style, andnode.set_value_style.relativeis gone fromnode.set_position.Other Changes
alertfunction.graph.random()method.More changes can be found in the release notes.
Conclusion
That's basically it to PyNode Next v2. I hope you enjoy using it, and continue to send back your feedback to the GitHub Issues page.
Documentation for PyNode Next v2 should be up on the website soon. And a reminder that you can update to PyNode Next v2 by downloading it from the releases page.
Beta Was this translation helpful? Give feedback.
All reactions