New Features
---------------
- Function call will be recorded in macro even if it is called programmatically. Accordingly, macro history is newly introduced to avoid recording too much.
- Even if a sub magic class is defined outside the main magic class and used as a part of it, class will be copied and name space is correctly modified. Now you don't have to literally nest classes. Instead of
python
magicclass
class Main:
magicclass
class A:
...
you can define them separately to keep codes clean.
python
magicclass
class A:
...
magicclass
class Main:
A_widget = A
- `Logger` widget is available in `magicclass.widgets`. This is a very powerful widget for outputs. You can stream `print`, `logging` outputs into the widget using context manager `logger.set_stdout()` and `logger.set_logger()`, or `plt.plot` in this widget just like inline plot using `logger.set_plt()`.
- Fields can be created if `widget_type` is specified.
- Useful types in `magicclass.types`. If `List`, `Tuple` or `Optional` is imported from this submodule, these type annotations will be recognized by `magicgui` and converted into `ListEdit`, `TupleEdit` and `OptionalWidget` respectively. These are temporary ones and may be replaced by `magicgui` in the future.
- `RangeSlider` and `FloatRangeSlider` are available in `magicclass.widgets`. These are temporary ones and may be replaced by `magicgui` in the future.
Bug fixes
----------
- Sub widgets were sometimes completely hidden if closed in `napari`.
- If multiple viewers are created, macro did not work.
Changes
---------
- `__call__` will not be converted to widget because it is meaningless.
- Macro recording of function calls.
- Some types and variables such as `Bound` will be deleted from the main module. They should be imported from submodules from now on. `DeprecationWarning` is raised but will be error in the future.