Skip to content

Commit

Permalink
generate_model_catalog.py doesn't use viewser anymore
Browse files Browse the repository at this point in the history
  • Loading branch information
Borbála Farkas authored and Borbála Farkas committed Oct 29, 2024
1 parent 8b37ce7 commit 3bb2e3c
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 133 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/check_if_new_model_added.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ jobs:
echo $removed_dirs
if [ -n "$new_dirs" ] || [ -n "$removed_dirs" ]; then
python documentation/catalogs/generate_model_catalog.py
if [ $? -ne 0 ]; then
echo "Generating catalogs failed."
exit 1
fi
echo "Model catalog is updated."
else
echo "No new or removed folders detected."
Expand Down
14 changes: 6 additions & 8 deletions documentation/catalogs/generate_model_catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def extract_models(model_class):
code = file.read()
exec(code, {}, tmp_dict)
model_dict.update(tmp_dict['get_meta_config']())
model_dict['queryset'] = create_link(model_dict['queryset'], model_class.queryset_path)
model_dict['queryset'] = create_link(model_dict['queryset'], model_class.queryset_path) if 'queryset' in model_dict else 'None'


if os.path.exists(config_deployment):
Expand All @@ -68,9 +68,7 @@ def extract_models(model_class):
if os.path.exists(config_hyperparameters):
logging.info(f"Found hyperparameters config: {config_hyperparameters}")
model_dict['hyperparameters'] = create_link(f"hyperparameters {model_class.model_name}", Path(model_class.get_scripts()['config_hyperparameters.py']))

model_dict['level'] = model_class.get_queryset().loa if model_class.get_queryset() else None


return model_dict


Expand Down Expand Up @@ -143,19 +141,19 @@ def generate_markdown_table(models_list):

if os.path.isdir(model_path):
model_class = ModelPath(model_name, validate=True)
#model_class.add_paths_to_sys()



model = extract_models(model_class)

if model['level'] == 'priogrid_month':
if 'level' in model and model['level'] == 'pgm':
models_list_pgm.append(model)
if model['level'] == 'country_month':
if 'level' in model and model['level'] == 'cm':
models_list_cm.append(model)



#model_class.remove_paths_from_sys()



markdown_table_pgm = generate_markdown_table(models_list_pgm)
Expand Down
3 changes: 0 additions & 3 deletions models/caring_fish/README.md

This file was deleted.

20 changes: 0 additions & 20 deletions models/caring_fish/configs/config_deployment.py

This file was deleted.

14 changes: 0 additions & 14 deletions models/caring_fish/configs/config_hyperparameters.py

This file was deleted.

19 changes: 0 additions & 19 deletions models/caring_fish/configs/config_meta.py

This file was deleted.

29 changes: 0 additions & 29 deletions models/caring_fish/configs/config_sweep.py

This file was deleted.

39 changes: 0 additions & 39 deletions models/caring_fish/main.py

This file was deleted.

1 change: 0 additions & 1 deletion models/caring_fish/requirements.txt

This file was deleted.

0 comments on commit 3bb2e3c

Please sign in to comment.