-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |