Mmodel

Latest version: v0.6.2

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

Scan your dependencies

Page 1 of 3

0.6.2

--------------------

Changed
^^^^^^^

- `set_node_object` accepts additional keyword arguments.
- Allow ``modifier_shortcut`` to change the model name.

0.6.1

-----------------------

Fixed
^^^^^

- Fix issue 14, where the escaped "\\n" does not display correctly
in the graphviz dot graph.

0.6.0

-----------------------

Version 0.6.0 is a major update with a new Model and modifier API.
The new API aims to simplify the model definitions and allow for external
Python decorators.

Changed
^^^^^^^

- The "handler" argument in the Model class takes the handler class, and additional
parameters are passed to the Model class as keyword arguments.
- The modifiers are now defined as proper decorators to facilitate the
integration with decorators from other Python libraries.
- The "modifier" argument in the ModelGraph and Model class takes the modifier
after the argument definition.
- Modifier naming change to simplify the definition.
- Node object definition allows user-defined attributes.

Added
^^^^^

- Add shortcut module.
- Add a lambda parser that attempts to extract lambda function expression.
- Add ``profile_time`` modifier.
- Add metadata parsing ability to modifiers.

0.5.2

-----------------------

Fixed
^^^^^

- Fix the issue where ``deepcopy`` does not copy the "_parser" attribute.
- Fix the inconsistency of format in metadata when the object doesn't have a name.

Changed
^^^^^^^

- Change the subgraph from a view to a copy of the graph.

0.5.1

-----------------------

Fixed
^^^^^

- Fix the issue ``modify_node`` doesn't remove the old modifiers.

Changed
^^^^^^^

- Change "executor" to a private Model class attribute ``Model._executor``.
- Change test node functions and docstring for consistency.
- Change the "full" style to "verbose" in metadata and drawing methods.

Added
^^^^^

- Add "order" attribute to the Model class to show the order of the execution.
- Add "metadata" module to format metadata information.
- Add graph information to model metadata.

0.5.0

------------------------
The package is moved to `Marohn Group <https://github.com/Marohn-Group/mmodel>`_.

API Change
^^^^^^^^^^

- Change graph API where individual nodes can only have a single output.
- Change node attribute "base_func" to "_func".
- Change model attribute "base_graph" to "graph".
- Change edge attribute "val" to "var".
- Change ``view_node`` to ``node_metadata``.
- Change ``util.modify_subgraph`` function to ``util.replace_subgraph``.
- Change ``subgraph_by_parameters`` and ``subgraph_by_returns`` to
``subnodes_by_inputs`` and ``subnodes_by_outputs``.
- Change ``model_signature`` and ``model_returns`` to
``modelgraph_signature`` and ``modelgraph_returns``
add both as methods in the graph class.
- Change "returns" to "output". The value should be a string.
- Parameter "returns" is a Model exclusive parameter that denotes the graph output.
- Change ``Model.get_node_object`` to ``Model.get_node_func``, the base function is
returned.

Fixed
^^^^^

- Fix the issue where modify subgraph cannot add inputs or modifiers.
- Fix the issue in tests that node attributes are not compared in `graph_equal()`.
- Fix the issue that the original graph freezes when creating a model.
- Fix the inconsistency between node and model metadata.
- Fix the issue that "None" is included in the returns list.

Changed
^^^^^^^^

- Model string output wraps each line at 80 characters.
- ``signature_modifier`` can modify the function with "kwargs".
- Default keyword argument does not show up in the model signature.
- Model's graph checking generates more detailed exception messages.
- Allow isolated graphs in the model (for single-node models).
- The subgraph method of the graph is modified to create a subgraph with
inputs and outputs.
- ``model.graph`` is a property method. A new copy of the graph is created
every time.
- Specified inputs are no longer added to the modifier list, and the base function is
modified.
- Model and graph drawing no longer take method as input. Instead, three style
options are given, plain, short, and full.

Added
^^^^^^

- Add graph modification when less than graph returns are specified.
- Add "__name__" attribute to handler instance.
- ``pos_signature_modifier`` allows for node objects to have positional-only parameters.
- Graph node definition allows for built-in and numpy.ufunc functions.
- Graph node inputs allow default value with a (parameter, default) tuple.
- Add name attribute to Model.
- Add export to graph and model's ``draw`` method.
- Add a "parser" module that parses functions based on different types.
- Add function documentation in metadata.
- Add Python 3.11 testing with tox.

Page 1 of 3

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.