Magic-class

Latest version: v0.7.14

Safety actively analyzes 681866 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 7 of 11

0.5.17

This release fixed an important bug in `v0.5.16`.

Bug Fixes
-----------
- `NameError` when optional packages are not installed.
- `labels=False` option in menu bar and toolbar took no effect.

Changes
----------
- All the extended widgets such as `QtConsole` and `QtPlotCanvas` are moved to `magicclss.ext` submodule. They are no longer available in `magicclass.widgets`.

Improvements
----------------
- Better typing in `MagicField`. For instance, if you have a field `f = field(SpinBox)` then type checker knows that `f` will be a `SpinBox` when accessed via GUI instance.
- Containers with scroll area (`magicclass` options `widget_type="scrollable"` or `widget_type="draggable"`) will assign menu bar and tool bar outside their scroll area so that menu bar and tool bar are always visible.

0.5.16

New Features
---------------
- New methods `add_text`, `add_infline` in `pyqtgraph` based widgets.
- Initial support for `pyvista` (WIP). Available in `magicclass.widgets`
- Both menu and toolbar can be defined in non-main window.
- `set_options` can take `auto_call`, `call_button`, `layout` arguments.

Bug Fixes
----------
- `MagicField` callback bug fix.
- Toolbar updates its style sheet when added to `napari` viewer.
- Update `FunctionGui` categorical widgets hidden in buttons and actions.

0.5.15

New Features
---------------
- Many updates in `pyqtgraph` based widgets.
- `QtPlotCanvas` supports histogram and bar plot. It also has a linear region item in `canvas.region` by default.
- `QtImageCanvas` has scale bar by default. The LUT histogram is hidden by the button on the upper-left corner now.
- Much more unified API between line plot item, scatter plot item and others, such as `face_color`, `edge_color` and `symbol`.
- `QtMultiPlotCanvas`, `QtMultiImageCanvas` can contain multiple plots and images in a single widget.
- `Qt2YPlotCanvas` has two Y-axis and shared X-axis.
- `to_napari` function is available in `magicclass.ext` submodule. Any magic classes, no matter it is a widget or a menu, can directly docked into `napari` viewer by simple syntax:
python
from magicclass.ext import to_napari
to_napari
magicclass
class A: ...

- Now functions can be converted into buttons or menus **after** construction of magic classes. This also follows the `magicgui`'s typing rule.
python
def func(a: int): ...
ui.Menu.append(func) this code will create a new action in Menu.


Changes
----------
- `parent_viewer` finds viewer ancestor in a safer way now. It uses `napari`'s method so that it will also work with newer `napari` in the future.
- Use pyi file to improve code completion.

0.5.14

New Features
---------------
- `magictoolbar` creates a `ToolBarGui`, which appears as a tool bar on the top of a widget. It is inter-nestable with `magicmenu`.
- Horizontal collapsible container using `widget_type="hcollapsible"`.
- Automatically determine how to execute `QApplication`. In the previous versions you had to add such as `input()` to prevent application exiting immediately if you ran a ".py" file with `python` command. Now you don't have to do that.
- Icon supports in many widgets.
- `icon_path` is now a universal option for widgets and fields. It can be used as `magicclass(icon_path="...")`, `field(int, options={"icon_path": "..."})`.
- `ConsoleTextEdit` has new property `tab_size`, with which you can set the size of tab.

Bug Fixes
-----------
- Checkable actions in menus were not working.
- `wraps` was not working when a magic class was defined locally.

Others
-------
- Added many tests.
- Remove `matplotlib` dependency.

0.5.13

Bug Fixes
-----------
- Fix annotations for Python 3.8.
- `wraps` and `FunctionGui` was not compatible.
- Some popup modes was not correctly working.
- Fix typo of "draggable".

0.5.12

New Features
---------------
- **Built-in macro widget is working**! Get executable scripts by `str(ui.macro)`, or show the widget by `ui.macro.widget.show()`. This widget is already equipped with many functions, such as "create macro" or "run macro".
- **Help widget is working**! Use `build_help` to make illustrated documentation automatically.
- `datetime` objects are correctly recorded in macro. With `macro-kit>=0.3.3`, the `datetime` module is automatically passed to `eval` function so that macro can be executed safely.
- Menu bar objects support rendering similar to `Widget`.
- New container variation `DraggableContainer` is available. Instead of scrolling using scroll bar, this container supports scrolling by mouse drag. Create by `magicclass(widget_type="draggable")`.

Changes
---------
- The `create_macro` method will cause deprecation warning. It will be removed soon. Use `ui.macro` instead.
- Delayed `matplotlib` import.

Bug Fixes
----------
- `MagicValueField` was not compatible with latest macro recording system.

Page 7 of 11

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.