Metadata about an experiment. All fields have default values: i.e., they will always be present on the object, but may be omitted in a constructor call. Attributes: data_location: A human-readable description of the data source, such as a path to a directory on disk.
| 482 | |
| 483 | |
| 484 | class ExperimentMetadata: |
| 485 | """Metadata about an experiment. |
| 486 | |
| 487 | All fields have default values: i.e., they will always be present on |
| 488 | the object, but may be omitted in a constructor call. |
| 489 | |
| 490 | Attributes: |
| 491 | data_location: A human-readable description of the data source, such as a |
| 492 | path to a directory on disk. |
| 493 | experiment_name: A user-facing name for the experiment (as a `str`). |
| 494 | experiment_description: A user-facing description for the experiment |
| 495 | (as a `str`). |
| 496 | creation_time: A timestamp for the creation of the experiment, as `float` |
| 497 | seconds since the epoch. |
| 498 | """ |
| 499 | |
| 500 | def __init__( |
| 501 | self, |
| 502 | *, |
| 503 | data_location="", |
| 504 | experiment_name="", |
| 505 | experiment_description="", |
| 506 | creation_time=0, |
| 507 | ): |
| 508 | self._data_location = data_location |
| 509 | self._experiment_name = experiment_name |
| 510 | self._experiment_description = experiment_description |
| 511 | self._creation_time = creation_time |
| 512 | |
| 513 | @property |
| 514 | def data_location(self): |
| 515 | return self._data_location |
| 516 | |
| 517 | @property |
| 518 | def experiment_name(self): |
| 519 | return self._experiment_name |
| 520 | |
| 521 | @property |
| 522 | def experiment_description(self): |
| 523 | return self._experiment_description |
| 524 | |
| 525 | @property |
| 526 | def creation_time(self): |
| 527 | return self._creation_time |
| 528 | |
| 529 | def _as_tuple(self): |
| 530 | """Helper for `__eq__` and `__hash__`.""" |
| 531 | return ( |
| 532 | self._data_location, |
| 533 | self._experiment_name, |
| 534 | self._experiment_description, |
| 535 | self._creation_time, |
| 536 | ) |
| 537 | |
| 538 | def __eq__(self, other): |
| 539 | if not isinstance(other, ExperimentMetadata): |
| 540 | return False |
| 541 | return self._as_tuple() == other._as_tuple() |
no outgoing calls
no test coverage detected
searching dependent graphs…