|
7 | 7 | from psij.utils import path_object_to_full_path as o2p |
8 | 8 |
|
9 | 9 |
|
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 | | - |
27 | 10 | class JobSpec(object): |
28 | 11 | """A class to hold information about the characteristics of a:class:`~psij.Job`.""" |
29 | 12 |
|
@@ -122,24 +105,6 @@ def _init_job_spec_dict(self) -> Dict[str, Any]: |
122 | 105 |
|
123 | 106 | return job_spec |
124 | 107 |
|
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 | | - |
143 | 108 | @property |
144 | 109 | def to_dict(self) -> Dict[str, Any]: |
145 | 110 | """Returns a dictionary representation of this object.""" |
|
0 commit comments