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

Fix incorrect reference to BOCPD model in factory #124

Merged
merged 2 commits into from
Sep 14, 2022

Conversation

jonwiggins
Copy link
Contributor

Hello,

Currently there seems to be an issue creating BOCPD models via the model factory:

from merlion.models.factory import ModelFactory

ModelFactory.create("BOCPD")

yields

File ~/.local/lib/python3.8/site-packages/merlion/models/factory.py:73, in ModelFactory.get_model_class(cls, name)
     71 @classmethod
     72 def get_model_class(cls, name: str) -> Type[ModelBase]:
---> 73     return dynamic_import(name, import_alias)

File ~/.local/lib/python3.8/site-packages/merlion/utils/misc.py:166, in dynamic_import(import_path, alias)
    163 if ":" not in import_path:
    164     import_path = alias[import_path]
--> 166 module_name, objname = import_path.split(":")
    167 m = importlib.import_module(module_name)
    168 return getattr(m, objname)

ValueError: not enough values to unpack (expected 2, got 1)

I believe this change fixes that. Let me know if you need me to make any changes.

Thanks,
Jon

@salesforce-cla
Copy link

Thanks for the contribution! Before we can merge this, we need @jonwiggins to sign the Salesforce.com Contributor License Agreement.

Copy link
Contributor

@aadyotb aadyotb left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution! This looks good to me.

@aadyotb aadyotb merged commit ab90426 into salesforce:main Sep 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants