Skip to content

Commit

Permalink
Add book-keeping fields.
Browse files Browse the repository at this point in the history
  • Loading branch information
cuihantao committed May 26, 2024
1 parent 49e777f commit 340f355
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion andes/core/model/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ def __init__(self, system=None, config=None):
self.calls = ModelCall() # callback and LaTeX string storage
self.triplets = JacTriplet() # Jacobian triplet storage
self.syms = SymProcessor(self) # symbolic processor instance
self.docum = Documenter(self)
self.docum = Documenter(self) # documenter instance

# cached class attributes
self.cache.add_callback('all_vars', self._all_vars)
Expand Down Expand Up @@ -285,6 +285,7 @@ def __init__(self, system=None, config=None):
self.coeffs = dict() # pu conversion coefficient storage
self.bases = dict() # base storage, such as Vn, Vb, Zn, Zb
self.debug_equations = list() # variable names for debugging corresponding equation
self.non_top_level = list() # list of non-top-level components

def _register_attribute(self, key, value):
"""
Expand Down Expand Up @@ -346,6 +347,7 @@ def _register_attribute(self, key, value):
var_instance.name = f'{prepend}{var_name}'
var_instance.tex_name = f'{var_instance.tex_name}_{{{tex_append}}}'
self.__setattr__(var_instance.name, var_instance)
var_instance.not_top_level = True

def _check_attribute(self, key, value):
"""
Expand Down

0 comments on commit 340f355

Please sign in to comment.