Skip to content

Commit

Permalink
ensure all subclasses of variable require name to be a valid python i…
Browse files Browse the repository at this point in the history
…dentifier

First step for solving #274. This covers all outcome and parameter classes.

Still remaining are constants and potentially all Point subclasses.
  • Loading branch information
quaquel committed Oct 31, 2023
1 parent 81a1f49 commit 05c31f4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions ema_workbench/em_framework/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,13 @@ def variable_name(self, name):
name = [name]
self._variable_name = name

def __init__(self, name):
try:
name.isidentifier()
except Exception as e:
raise e
super().__init__(name)


class NamedObjectMap:
def __init__(self, kind): # @ReservedAssignment
Expand Down
Binary file removed test/data/test.tar.gz
Binary file not shown.

0 comments on commit 05c31f4

Please sign in to comment.