|
2 | 2 | import logging |
3 | 3 |
|
4 | 4 | from octue.definitions import OUTPUT_STRANDS |
5 | | -from octue.exceptions import ProtectedAttributeException |
6 | 5 | from octue.mixins import Identifiable, Loggable, Serialisable, Taggable |
7 | 6 | from octue.resources.manifest import Manifest |
8 | 7 | from octue.utils.encoders import OctueJSONEncoder |
@@ -62,27 +61,11 @@ def __init__(self, twine, skip_checks=False, **kwargs): |
62 | 61 | # Pop any possible strand data sources before init superclasses (and tie them to protected attributes) |
63 | 62 | strand_kwargs = ((name, kwargs.pop(name, None)) for name in ALL_STRANDS) |
64 | 63 | for strand_name, strand_data in strand_kwargs: |
65 | | - self.__setattr__(f"_{strand_name}", strand_data) |
| 64 | + setattr(self, f"{strand_name}", strand_data) |
66 | 65 |
|
67 | 66 | # Init superclasses |
68 | 67 | super().__init__(**kwargs) |
69 | 68 |
|
70 | | - def __setattr__(self, name, value): |
71 | | - """ Override setters for protected attributes (the strand contents may change, but the strands themselves |
72 | | - shouldn't be changed after instantiation) |
73 | | - """ |
74 | | - if name in ALL_STRANDS: |
75 | | - raise ProtectedAttributeException(f"You cannot set {name} on an instantiated Analysis") |
76 | | - |
77 | | - super().__setattr__(name, value) |
78 | | - |
79 | | - def __getattr__(self, name): |
80 | | - """ Override public getters to point to protected attributes (the strand contents may change, but the strands |
81 | | - themselves shouldn't be changed after instantiation) |
82 | | - """ |
83 | | - if name in ALL_STRANDS: |
84 | | - return getattr(self, f"_{name}", None) |
85 | | - |
86 | 69 | def finalise(self, output_dir=None): |
87 | 70 | """ Validates and serialises output_values and output_manifest, optionally writing them to files |
88 | 71 |
|
|
0 commit comments