engforge.engforge_attributes.AttributedBaseMixin
- class AttributedBaseMixin(name='')[source]
Bases:
LoggingMixinA mixin that adds the ability to configure all engforge.core attributes of a class
Initialize a filter.
Initialize with the name of the logger which, together with its children, will have its events allowed through the filter. If no name is specified, allow every event.
Methods
Overwrite this to modify logging fields
change_all_log_lvlrecursively checks class slots for the key, and returns the slot type
collects all the attributes for a system
collects all the attributes for a system
A routine to communicate to the root of the server network that there is an issue
Writes at a low level to the log file.
a context manager that will allow you to dynamically change any information, then will change it back in a fail safe way.
Writes to log as a error
extract_messageThis acts as the interface for logging.Filter Don't overwrite this, use add_fields instead.
hash by parm or by input_kw, only input can be hashed by lookup as system properties can create a recursive loop and should be deterministic from input
hash_numeric_withGenerates a hash for the object's dictionary representation, updated with additional keyword arguments.
Writes to log but with info category, these are important typically and inform about progress of process in general
Lists all input attributes for class
no attr base types, no tuples, no lists, no dicts
We only want std logging to start
converts to color and string via the termcolor library :type message:
str:param message: a string convertable entity :type color: :param color: a color in [grey,red,green,yellow,blue,magenta,cyan,white]Writes to log.
no tuples,lists, dicts, strings, or attr base types
Lists all plot attributes for class
reset log
resets log on all internal instance LoggingMixins
sets attributes from a dictionary
Lists all signals attributes for class
slack_notificationreturns all slot references in this configuration
Lists all slots attributes for class
Lists all signals attributes for class
the table attributes corresponding to
Lists all trace attributes for class
Lists all signals attributes for class
Writes to log as a warning
Attributes
returns values as they are in the class instance
attrs_fieldsidentityreturns values as they are in the class instance, but converts classes inputs to their input_as_dict
input_hashlog_fmtlog_levellog_onloggerrecursively gets internal components numeric_as_dict as well as its own numeric values
numeric_hashslack_webhook_urltable_hashreturns values as they would be put in a table row from this instance ignoring any sub components
unique_hash- add_fields(record)
Overwrite this to modify logging fields
- property as_dict
returns values as they are in the class instance
- classmethod check_ref_slot_type(sys_key)[source]
recursively checks class slots for the key, and returns the slot type
- Return type:
list- Parameters:
sys_key (str)
- critical(*args)
A routine to communicate to the root of the server network that there is an issue
- debug(*args)
Writes at a low level to the log file… usually this should be detailed messages about what exactly is going on
- difference(**kwargs)[source]
a context manager that will allow you to dynamically change any information, then will change it back in a fail safe way.
- with self.difference(name=’new_name’, value = new_value) as new_config:
#do stuff with config, ok to fail
you may not access any “private” variable that starts with an _ as in _whatever
difference is useful for saving slight differences in configuration in conjunction with solve you might create wrappers for eval, or implement a strategy pattern.
only attributes may be changed.
#TODO: allow recursive operation with sub comps or systems. #TODO: make a full system copy so the system can be reverted later
- error(error, msg='')
Writes to log as a error
- filter(record)
This acts as the interface for logging.Filter Don’t overwrite this, use add_fields instead.
- hash(*args, **input_kw)[source]
hash by parm or by input_kw, only input can be hashed by lookup as system properties can create a recursive loop and should be deterministic from input
- hash_with(**input_kw)[source]
Generates a hash for the object’s dictionary representation, updated with additional keyword arguments. :type **input_kw: :param **input_kw: Arbitrary keyword arguments to update the object’s dictionary representation.
- Returns:
The hash value of the updated dictionary.
- Raises:
Any exceptions raised by deepdiff.DeepHash if hashing fails. –
- info(*args)
Writes to log but with info category, these are important typically and inform about progress of process in general
- property input_as_dict
returns values as they are in the class instance, but converts classes inputs to their input_as_dict
- classmethod input_fields(add_ign_types=None)[source]
no attr base types, no tuples, no lists, no dicts
- Parameters:
add_ign_types (list | None)
- installSTDLogger()
We only want std logging to start
- message_with_identiy(message, color=None)
converts to color and string via the termcolor library :type message:
str:param message: a string convertable entity :type color: :param color: a color in [grey,red,green,yellow,blue,magenta,cyan,white]- Parameters:
message (str)
- msg(*args, lvl=5)
Writes to log… this should be for raw data or something… least priorty
- property numeric_as_dict
recursively gets internal components numeric_as_dict as well as its own numeric values
- classmethod plot_attributes()[source]
Lists all plot attributes for class
- Return type:
Dict[str,Attribute]
- resetLog()
reset log
- resetSystemLogs(reseted=None)
resets log on all internal instance LoggingMixins
- classmethod signals_attributes()[source]
Lists all signals attributes for class
- Return type:
Dict[str,Attribute]
- classmethod slots_attributes(attr_type=False)[source]
Lists all slots attributes for class
- Return type:
Dict[str,Attribute]
- classmethod solvers_attributes()[source]
Lists all signals attributes for class
- Return type:
Dict[str,Attribute]
- property table_row_dict
returns values as they would be put in a table row from this instance ignoring any sub components
- classmethod trace_attributes()[source]
Lists all trace attributes for class
- Return type:
Dict[str,Attribute]
- classmethod transients_attributes()[source]
Lists all signals attributes for class
- Return type:
Dict[str,Attribute]
- warning(*args)
Writes to log as a warning