You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Feature request
I would like to be able to see config definitions through Python. This might be achieved through a Python side set of definitions. This could also exist alongside config requirements that automatically check a config for consistency and that requirements are met.
In pseudo code:
Class lephareConfigParameter:
def __init__(self,name=None,description=None,value=None,assertion=True):
self.name=name
self.definition=definition
self.value=value
self.assertion=assertion
def check_value(self,config):
assert assertion(config,self.value)
def check_err_scale(config,value):
"Check errscale is the same length as other filter related parameters and that they exist"
if "FILTER_LIST" not in config:
print("FILTER_LIST is not present")
return False
elif "FILTER_CALIB" not in config:
print("FILTER_CALIB is not present")
return False
if len(str(value).split(',')) != len(str(config["FILTER_LIST"]).split(','))
print("FILTER_LIST and ERR_SCALE are different lengths")
return False
elif len(str(value).split(',')) != len(str(config["FILTER_CALIB"]).split(','))
print("FILTER_CALIB and ERR_SCALE are different lengths")
return False
return True
allowed_config=dict(
# All the allowed configs
"ERR_SCALE": lephareConfigParameter(
name="ERR_SCALE",
description="The error scaling. Must be equal in length to FILTER_LIST and FILTER_CALIB",
assertion=check_err_scale,
)
]
required_config=[
#configs that are required
"ERR_SCALE",
]
def check_config(config):
for c in config:
assert c in allowed_config
allowed_config[c].check_value()
for c in required_config:
assert c in config
Before submitting
Please check the following:
I have described the purpose of the suggested change, specifying what I need the enhancement to accomplish, i.e. what problem it solves.
I have included any relevant links, screenshots, environment information, and data relevant to implementing the requested feature, as well as pseudocode for how I want to access the new functionality.
If I have ideas for how the new feature could be implemented, I have provided explanations and/or pseudocode and/or task lists for the steps.
The text was updated successfully, but these errors were encountered:
Feature request
I would like to be able to see config definitions through Python. This might be achieved through a Python side set of definitions. This could also exist alongside config requirements that automatically check a config for consistency and that requirements are met.
In pseudo code:
Before submitting
Please check the following:
The text was updated successfully, but these errors were encountered: