Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove external_class as config parameter #67

Closed
wants to merge 1 commit into from

Conversation

drewoldag
Copy link
Collaborator

@drewoldag drewoldag commented Sep 19, 2024

Removing external_class as a config parameter, and checking if name is a key the registry or a libpath.

In the case of an externally defined model and config file, if the user specified the external_class as the model to use, we would instead default to the model defined in the name key of the fibad_default_config.toml file. Clearly not what the user would expect.

So for now, we allow name tobe either a key into the registry dictionary or a libpath string for an external model class.

This isn't quite where I would like it. There are plenty of exceptions raised, but it would be nice to add some simple logging as well.

@drewoldag drewoldag self-assigned this Sep 19, 2024
Copy link

codecov bot commented Sep 19, 2024

Codecov Report

Attention: Patch coverage is 83.33333% with 1 line in your changes missing coverage. Please review.

Project coverage is 37.60%. Comparing base (2fb3a74) to head (fa20613).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
src/fibad/train.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #67      +/-   ##
==========================================
- Coverage   38.33%   37.60%   -0.74%     
==========================================
  Files          17       17              
  Lines         720      734      +14     
==========================================
  Hits          276      276              
- Misses        444      458      +14     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

Before [a723812] After [aab7817] Ratio Benchmark (Parameter)
2.66k 2.78k 1.04 benchmarks.mem_list
4.04±0.2s 3.71±0.9s 0.92 benchmarks.time_computation

Click here to view all benchmarks.

Copy link
Collaborator

@mtauraso mtauraso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -27,22 +27,22 @@ def get_or_load_class(config: dict, registry: dict) -> type:
a `name` nor `external_cls` key was found in the config.
"""

# User specifies one of the built in classes by name
#! Once we have confidence in the config having default values, we can remove this check
if "name" in config:
class_name = config.get("name")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the new config stuff went in you will probably have to make this config[name] to get it working again.

@drewoldag drewoldag closed this Sep 23, 2024
@drewoldag drewoldag deleted the issue/65/config-name-or-external-cls-bug branch September 23, 2024 20:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants