Skip to content

Commit

Permalink
Format
Browse files Browse the repository at this point in the history
  • Loading branch information
jinningwang committed Nov 23, 2024
1 parent f56052e commit 1fec2ef
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion ams/core/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -804,7 +804,7 @@ class VarReduction(NumOp):
u : Callable
The input matrix variable.
fun : Callable
The reduction function that takes a shape parameter (1D shape) as input.
The reduction function that takes a shape argument (1D shape) as input.
name : str, optional
The name of the instance.
tex_name : str, optional
Expand Down
4 changes: 1 addition & 3 deletions ams/routines/dcpf.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,13 +155,11 @@ def unpack(self, **kwargs):
idx = exprc.owner.get_idx()
except AttributeError:
idx = exprc.owner.idx.v

Check warning on line 157 in ams/routines/dcpf.py

View check run for this annotation

Codecov / codecov/patch

ams/routines/dcpf.py#L154-L157

Added lines #L154 - L157 were not covered by tests
else:
pass

try:
exprc.owner.set(src=exprc.src, idx=idx, attr='v', value=exprc.v)
except (KeyError, TypeError):
logger.error(f'Failed to unpack <{exprc}> to <{exprc.owner.class_name}>.')

Check warning on line 162 in ams/routines/dcpf.py

View check run for this annotation

Codecov / codecov/patch

ams/routines/dcpf.py#L159-L162

Added lines #L159 - L162 were not covered by tests
pass

# label the most recent solved routine
self.system.recent = self.system.routines[self.class_name]
Expand Down
6 changes: 4 additions & 2 deletions ams/routines/pflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,11 @@ def unpack(self, **kwargs):
self.vBus.optz.value = sys.Bus.get(src='v', attr='v', idx=self.vBus.get_idx())
return True

def update(self, **kwargs):
def update(self, params=None, build_mats=False):
"""
Placeholder.
This method updates the parameters in the optimization model. In this routine,
the `params` and `build_mats` arguments are not used because the parameters
are updated directly to the ANDES system.
"""
if not self.initialized:
self.init()
Expand Down

0 comments on commit 1fec2ef

Please sign in to comment.