Update one or more properties from a dict or from input keyword arguments. Parameters ---------- d: dict Dictionary from property names to new property values. kwargs Named argument value pairs where the name is a configurati
(self, d={}, **kwargs)
| 178 | reset_status() |
| 179 | |
| 180 | def update(self, d={}, **kwargs): |
| 181 | """ |
| 182 | Update one or more properties from a dict or from input keyword |
| 183 | arguments. |
| 184 | |
| 185 | Parameters |
| 186 | ---------- |
| 187 | d: dict |
| 188 | Dictionary from property names to new property values. |
| 189 | |
| 190 | kwargs |
| 191 | Named argument value pairs where the name is a configuration |
| 192 | property name and the value is the new property value. |
| 193 | |
| 194 | Returns |
| 195 | ------- |
| 196 | None |
| 197 | |
| 198 | Examples |
| 199 | -------- |
| 200 | Update configuration properties using a dictionary |
| 201 | |
| 202 | >>> import plotly.io as pio |
| 203 | >>> pio.orca.config.update({'timeout': 30, 'default_format': 'svg'}) |
| 204 | |
| 205 | Update configuration properties using keyword arguments |
| 206 | |
| 207 | >>> pio.orca.config.update(timeout=30, default_format='svg'}) |
| 208 | """ |
| 209 | # Combine d and kwargs |
| 210 | if not isinstance(d, dict): |
| 211 | raise ValueError( |
| 212 | """ |
| 213 | The first argument to update must be a dict, \ |
| 214 | but received value of type {typ}l |
| 215 | Received value: {val}""".format(typ=type(d), val=d) |
| 216 | ) |
| 217 | |
| 218 | updates = copy(d) |
| 219 | updates.update(kwargs) |
| 220 | |
| 221 | # Validate keys |
| 222 | for k in updates: |
| 223 | if k not in self._props: |
| 224 | raise ValueError("Invalid property name: {k}".format(k=k)) |
| 225 | |
| 226 | # Apply keys |
| 227 | for k, v in updates.items(): |
| 228 | setattr(self, k, v) |
| 229 | |
| 230 | def reload(self, warn=True): |
| 231 | """ |
no test coverage detected