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
I've discovered that the Parameter's averaging param will get reset back to ["1-hour", "24-hour"] if the PM2.5 option is chosen from SDFS options (I think this will happen to any SDFS option).
Expected behavior
For the sensortoolkit.Parameter to be as set, ['24-hour'].
Details
Tracing back the error:
sensortoolkit.Parameter will override parameters if name is found in __param_dict__ (in this case, name is PM2.5) inside _parameter.py:
__param_dict is stored and regenerated from param_info.json stored in C:\Users\<UserName>\AppData\Local\USEPA\sensortoolkit through this initialization inside __init__.py:
_lib_path=_os.path.dirname(_os.path.abspath(__file__))
_app_name='sensortoolkit'_app_author='USEPA'_app_data_dir=user_data_dir(_app_name, _app_author)
# Load in SDFS parameter attributes_param_dict= {}
data=Noneifnot_os.path.exists(_app_data_dir):
_os.makedirs(_app_data_dir)
# copy param data from site-packages to folder location (initial install)copy2(_os.path.join(_lib_path, 'param', 'param_info.json'),
_os.path.join(_app_data_dir, 'param_info.json'))
# load in param data at appdata location (including any custom params)withopen(_os.path.join(_app_data_dir, 'param_info.json'), 'r') asfile:
data=load(file)
forkey, valindata.items():
_param_dict[key] =val
Finally, the param_info.json file stored PM2.5 as having ["1-hour", "24-hour"] as option of averaging:
Description
While using this code:
I've discovered that the Parameter's
averaging
param will get reset back to["1-hour", "24-hour"]
if the PM2.5 option is chosen from SDFS options (I think this will happen to any SDFS option).Expected behavior
For the
sensortoolkit.Parameter
to be as set,['24-hour']
.Details
Tracing back the error:
sensortoolkit.Parameter
will override parameters ifname
is found in__param_dict__
(in this case,name
is PM2.5) inside_parameter.py
:__param_dict__
is derived from__param_dict
:__param_dict
is stored and regenerated fromparam_info.json
stored inC:\Users\<UserName>\AppData\Local\USEPA\sensortoolkit
through this initialization inside__init__.py
:param_info.json
file stored PM2.5 as having["1-hour", "24-hour"]
as option ofaveraging
:Suggested solutions
sensortoolkit.Parameter
to retain the user-specified values and not be overridden by preset SDFS values.The text was updated successfully, but these errors were encountered: