Skip to content

Commit

Permalink
Merge pull request #29 from jordanvolz/jav-122923
Browse files Browse the repository at this point in the history
Jav/122923 - bump library versions
  • Loading branch information
jordanvolz committed Jan 3, 2024
2 parents 27c2aa5 + 435d9ef commit 312f567
Show file tree
Hide file tree
Showing 11 changed files with 4,583 additions and 3,518 deletions.
22 changes: 19 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,26 @@ clean_examples:
echo "Finished cleaning examples!"


.PHONY: update_poetry
update_poetry:
.PHONY: poetry_update
poetry_update:
poetry update -v

.PHONY: poetry_lock
poetry_lock:
poetry lock --no-update

.PHONY: poetry_clear_cache
poetry_clear_cache:
poetry cache clear --all pypi
poetry update

.PHONY: poetry_install
poetry_install:
poetry install --all-extras

.PHONY: poetry_reset_env
poetry_reset_env:
poetry install --remove-untracked --all-extras


.PHONY: tests
tests: examples
Expand Down
2 changes: 1 addition & 1 deletion docs/src/regression.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ This guide will walk us through a quick example of predicting the age of crabs g
2. Now let's install the packages we'll need for this example:

```bash
pip3 install 'lolpop[cli,mlflow,duckdb,xgboost,dvc,evidently,deepchecks,optuna,yellowbrick,aif360,alibi]'
pip3 install 'lolpop[cli,mlflow,duckdb,xgboost,dvc,evidently,deepchecks,optuna,yellowbrick,aif360,alibi,feature-engine]'
```

3. This example will version data with dvc. In order to use it, we'll need a git repo to use with dvc. For the purposes of this guide, we'll create a git repository in our provider of choice named `lolpop_crab_age_example`. You'll then want to clone this repo locally via something like:
Expand Down
2 changes: 1 addition & 1 deletion lolpop/base_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ def __init__(self,
self.log("Loaded class %s into %s %s" %(type(getattr(self,integration)).__name__, child_integration_type, integration))
processed_integrations[integration] = obj
else:
self.log("Unable to load class for %s: %s" %(child_integration_type, integration))
self.log("Unable to load class for %s: %s" %(child_integration_type, integration), level="WARN")
else:
self.log("Integration %s already in default integrations. Skipping..." %integration)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def __init__(self, dependent_integrations=None, *args, **kwargs):
data_connector_cl_name=self._get_config("data_connector")
data_connector_config = self._get_config(
"data_connector_config", {})
data_connector_cl = utils.load_class(data_connector_cl_name)
data_connector_cl = utils.load_class(data_connector_cl_name, self_obj=self)
data_connector = data_connector_cl(
conf = {"config": data_connector_config},
parent=self,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def build_model(self, data, model_version, algo, params, trainer_config = None,
experiment = self.metadata_tracker.create_resource(id=None, type="experiment", parent=model_version)

#load model trainer and build model
model_cl = utils.load_class(algo)
model_cl = utils.load_class(algo,self_obj=self)
dependent_integrations = {"component": {"logger": self.logger, "notifier": self.notifier, "metadata_tracker": self.metadata_tracker,
"metrics_tracker": self.metrics_tracker, "resource_version_control": self.resource_version_control}}
if hasattr(self, "feature_transformer"): #pass the feature_transformer if it's defined at the pipeline level
Expand Down
4 changes: 2 additions & 2 deletions lolpop/component/metadata_tracker/mlflow_metadata_tracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ def load_model(self, model_obj, model_version, ref_model, *args, **kwargs):
model: the model trainer object
"""
model_trainer = self.get_metadata(model_version, "winning_experiment_model_trainer")
model_cl = utils.load_class(model_trainer)
model_cl = utils.load_class(model_trainer, self_obj=self)
dependent_integrations = {"component": {"logger": self.logger,
"notifier": self.notifier,
"metadata_tracker": self,
Expand Down Expand Up @@ -451,7 +451,7 @@ def load_model(self, model_obj, model_version, ref_model, *args, **kwargs):
if transformer_config is not None and isinstance(transformer_config, str):
transformer_config = utils.parse_dict_string(transformer_config)

transformer_cl = utils.load_class(transformer_class)
transformer_cl = utils.load_class(transformer_class, self_obj=self)
transformer = transformer_cl(conf={"config": transformer_config},
parent = self,
is_standalone=True,
Expand Down
2 changes: 1 addition & 1 deletion lolpop/component/model_trainer/base_model_trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def __init__(self, params=None, *args, **kwargs):
transformer_class = self._get_config("transformer_class")
if transformer_class is not None:
transformer_config = self.get_config("transformer_config")
transformer_cl = utils.load_class(transformer_class)
transformer_cl = utils.load_class(transformer_class, self_obj=self)
dependent_integrations = {"component": {"logger": self.logger, "notifier": self.notifier,
"metadata_tracker": self.metadata_tracker,
"resource_version_control": self.resource_version_control}}
Expand Down
27 changes: 15 additions & 12 deletions lolpop/utils/common_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,24 +121,27 @@ def load_class_obj(class_name, class_type="component", parent="lolpop"):
def load_class(class_name, class_type="component", plugin_mods = [], self_obj=None):
try:
cl = load_class_obj(class_name, class_type)
except:
except Exception as e1:
try:
if self_obj:
self_obj.log("Unable to find class %s in build-in resources. Searching extensions..." %class_name)
self_obj.log("Unable to find class %s in build-in resources (Error: %s). Searching extensions..." %(class_name,str(e1)))
cl = load_class_obj(class_name, class_type="extension")
if self_obj:
self_obj.log("Found class %s in extensions!" %class_name)
except:
if self_obj:
self_obj.log(
"Unable to find class %s in extensions. Searching plugins modules in %s..." %(class_name, str(plugin_mods)))
cl = load_class_from_plugin(class_name, plugin_mods, class_type)
if cl is not None:
if self_obj:
self_obj.log("Found class %s in plugins!" % class_name)
else:
except Exception as e2:
try:
if self_obj:
self_obj.log("Unable to find class %s in plugins!" %class_name)
self_obj.log(
"Unable to find class %s in extensions (Error: %s). Searching plugins modules in %s..." %(class_name, str(e2), str(plugin_mods)))
cl = load_class_from_plugin(class_name, plugin_mods, class_type)
if cl is not None:
if self_obj:
self_obj.log("Found class %s in plugins!" % class_name)
else:
if self_obj:
self_obj.log("Unable to find class %s in plugins!" %class_name)
except Exception as e3:
self_obj.log("Unable to load class %s from pluigins (Error: %s)" %(class_name, str(e3)))
return cl

#load class object from plugins
Expand Down
Loading

0 comments on commit 312f567

Please sign in to comment.