Description
Some of our tools assume that a file named .env
automatically exist in the tools directory. This happens when a py file uses the call to tools_shared_functions.get_metadata
. e.g.
metadata_url = f'{API_BASE_URL}/metadata'
metadata_list, metadata_df = get_metadata(metadata_url, select_by, selector)
Change eval_plots to bring in an arg to point to that file which can be saved and used from /data/config/xxxx.env.
e.g. (generate_categorical_fim.py will checking in this example:
parser.add_argument(
'-e',
'--env_file',
help='Docker mount path to the catfim environment file. ie) data/config/catfim.env',
required=True,
)
It can have a default value the same way "generate_categorical_fim.py" does.
There are a ton of scripts that have that problem, but maybe create a generic value via params_template.env to get the path to other env files (like catfim.env or somethign like wrds.env or something)
Note: eval_plots does not need or use that .env for WRDS for all calls. For normal alpha testing, it does not call WRDS, so does not look for the .env file. But for other uses such as files needed for production releases to HV, it does need it. And can only be run in the OWP enviros at this time.
Update: Apr 11, 2025: Some of the products have this fix in place now but eval_plot at least does not. The hard part is that it errors out as it can't find the WRDS service but it is hard to figure out why. There doesn't appear to be any notes or anything to show that the .env file is missing.
CatFIM, Eval and possibly others can likely share the same config.env file as they all use the same variable values. Then we can make that config file to a more generic name like "fim.env", and let all apps including CatFIM default the arg for it.
Note: It appears that not all values in that env file are used either.. but it doesn't need to be addressed now unless we want to clean it up, seeing as we are making changes related to it.