Skip to content

Commit

Permalink
correcting example
Browse files Browse the repository at this point in the history
  • Loading branch information
K20shores committed Sep 17, 2024
1 parent 07e548e commit 0e7b000
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.

This file was deleted.

13 changes: 11 additions & 2 deletions src/acom_music_box/examples/examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ class _Examples:
description='Many species involved in tropospheric-stratospheric chemistry')

@classmethod
def get_all(cls):
return [cls.CarbonBond5, cls.Chapman, cls.FlowTube, cls.Analytical, cls.TS1]
def get_all(self):
return [self.CarbonBond5, self.Chapman, self.FlowTube, self.Analytical, self.TS1]

def __iter__(self):
return iter(self.get_all())
Expand All @@ -58,6 +58,15 @@ def __getattr__(self, item):
if hasattr(self, item):
return getattr(self, item)
raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{item}'")

def __getitem__(self, item):
return self.get_all()[item]

def __repr__(self):
return f'Eamples: {self.get_all()}'

def __str__(self):
return f'Eamples: {self.get_all()}'


Examples = _Examples()

0 comments on commit 0e7b000

Please sign in to comment.