Skip to content

Commit

Permalink
user warnings update
Browse files Browse the repository at this point in the history
  • Loading branch information
GJHSimmons committed Jan 22, 2025
1 parent 695fb23 commit 14f5035
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
4 changes: 2 additions & 2 deletions psymple/build/abstract.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ def _check_existing_port_names(self, port: Port):
return False
elif port.name in self.parsing_locals:
warnings.warn(
f"Attempted to create port with name '{port.name}', but this is already defined "
f"in the parsing_locals dictionary {self.parsing_locals}. Port will not be created."
f"The parameter '{port.name}' has been specified as a system parameter. "
f"A port for '{port.name}' will not be created in '{self.name}'."
)
return False
else:
Expand Down
11 changes: 7 additions & 4 deletions psymple/build/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,13 @@ def add_system_parameter(
assert all([isinstance(s, str) for s in signature])
assert set(signature) == set(sym_signature)
else:
warnings.warn(
f"A signature for function {name} was not provided. The appearance of "
f"the function in displayed expressions may not be as expected."
)
try:
value = float(function)
except:
warnings.warn(
f"A signature for function {name} was not provided. The appearance of "
f"the function in displayed expressions may not be as expected."
)
signature = sym_signature
self._check_are_system_parameters(*signature)
sym_func = self._add_symbolic_function(name, function, signature)
Expand Down

0 comments on commit 14f5035

Please sign in to comment.