8000 Design discussion: avoid manual 'get' and 'set' functions · Issue #34 · ckolbPTB/InhomCorr · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Design discussion: avoid manual 'get' and 'set' functions #34
Open
@fzimmermann89

Description

@fzimmermann89

Like Python has built-in support for properties, it also has built-in functionality for indexable objects via getitem .
An example would be the get_data function in for the dataloaders. We could try to design it in a way that the QMRIDataLoader is indexable (Pseudo-Code):

class QMRIDataLoader:
     def __getitem__(self, id):
          return self.item[0]

Then, later one, we could use it as

obj=QMRIDataLoader(...)
obj[0]

This would make it more 'pythonic' and consistent, for example, with how pytorch datasets are supposed to work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0