Skip to content

Commit

Permalink
Added the Config class and main(). #29
Browse files Browse the repository at this point in the history
  • Loading branch information
sweverett committed Aug 7, 2019
1 parent 0df6821 commit 44dd23e
Showing 1 changed file with 50 additions and 0 deletions.
50 changes: 50 additions & 0 deletions clustr.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#-------------------------------------------------------
# We'll define useful classes here

class Config(object):
'''
Used for CluStR config processing
Some options:
- scale_luminosity: Divide luminosity columns by E(z)^-3/2
'''
_required_keys = []

def __init__(self, config_file):
with open(config_file, 'r') as stream:

self._config = yaml.safe_load(stream)

# TODO: Any logical parsing here:
#...

return

# The following are so we can access the config
# values similarly to a dict
def __getitem__(self, key):
return self._config.__dict__[key]

def __setitem__(self, key, value):
self._config.__dict__[key] = value

def __delitem__(self, key):
del self._config.__dict__[key]

def __contains__(self, key):
return key in self._config.__dict__

def __len__(self):
return len(self._config.__dict__)

def __repr__(self):
return repr(self._config.__dict__)

#-------------------------------------------------------
# We'll write the main function here

def main():
pass

if __name__ == '__main__':
main()

0 comments on commit 44dd23e

Please sign in to comment.