-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Thoughts on adding support for datasets #20
Comments
Is it the case that Regardless, I think it might make sense to split this up, and use the query function to filter to only get one type and expose each on the object. |
Your understanding of the types is correct. So you think we should create two new completely separate abstract classes DatasetVolume & DatasetFilesystem? What do you think about having a base class Dataset which DatasetVolume and DatasetFilesystem would inherit from? What about creating a data type for the four-value dicts returned for most of the values? How would you define that?
What do you think @sdwilsh ? |
All of this sounds reasonable.
Maybe something like this: class DatasetPropertyType(enum.Enum):
...
class DatasetProperty(object):
def __init__(self, parsed: Any, source: DatasetPropertyType) -> None:
self._value = parsed
self._source = source
@property
def value(self) -> Any:
return self._value
@property
def source(self) -> DatasetPropertyType:
return self._source It looks like |
#92 does the basics that are common between both of these. I might land that as-is, and we can then add an the additional specializations to it as needed (I do not need the specializations today for the Home Assistant integration). I didn't add the |
Looking at datasets, there are two types: FILESYSTEM & DATASET
They do not have the same fields. My first though on how to handle this, would be to have one abstract class Dataset with the
properties shared by both types of dataset. Then we would need two other classes ( DatasetFilesystem and DatasetDataset) implementng Dataset end expanding with relevant properties. What Class of object should be in the list datasets in Machine? That approach seems like a mess.
I guess you could just have the two abstract classes Filesystem & Dataset. Then the Machine would a list of datasets and another list of filesystems?
What do you think @sdwilsh ? What would be a good way to handle this?
Type filesystem
Type volume
The text was updated successfully, but these errors were encountered: