Skip to content

Commit de25698

Browse files
committed
Remove old check for environment
1 parent e323286 commit de25698

File tree

1 file changed

+0
-35
lines changed

1 file changed

+0
-35
lines changed

src/psij/job_spec.py

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,6 @@
77
from psij.utils import path_object_to_full_path as o2p
88

99

10-
class _EnvDict(dict):
11-
12-
def __init__(self, *args: Any, **kwargs: Any) -> None:
13-
14-
super().__init__(*args, **kwargs)
15-
16-
def __setitem__(self, k: str, v: str) -> None:
17-
18-
if not isinstance(k, str):
19-
raise TypeError('environment key "%s" is not a string (%s)'
20-
% (k, type(k).__name__))
21-
if not isinstance(v, str):
22-
raise TypeError('environment key "%s" has non-string value (%s)'
23-
% (k, type(v).__name__))
24-
super().__setitem__(k, v)
25-
26-
2710
class JobSpec(object):
2811
"""A class to hold information about the characteristics of a:class:`~psij.Job`."""
2912

@@ -122,24 +105,6 @@ def _init_job_spec_dict(self) -> Dict[str, Any]:
122105

123106
return job_spec
124107

125-
@property
126-
def environment(self) -> Optional[Dict[str, str]]:
127-
"""Set job environment.
128-
129-
The property setter will typecheck the provided env dictionary - only
130-
`Dict[str:str]` types are allowed.
131-
"""
132-
return self._environment
133-
134-
@environment.setter
135-
def environment(self, environment: Optional[Dict[str, str]]) -> None:
136-
if environment is None:
137-
self._environment = None
138-
else:
139-
self._environment = _EnvDict()
140-
for k, v in environment.items():
141-
self._environment[k] = v
142-
143108
@property
144109
def to_dict(self) -> Dict[str, Any]:
145110
"""Returns a dictionary representation of this object."""

0 commit comments

Comments
 (0)