Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Replace print statements with logging
  • Loading branch information
22quinn committed Jul 30, 2020
commit b6b1d7bd292ac160e94f84a8e34501d1a7883944
2 changes: 1 addition & 1 deletion openml/extensions/sklearn/extension.py
Original file line number Diff line number Diff line change
Expand Up @@ -1312,7 +1312,7 @@ def _prevent_optimize_n_jobs(self, model):
"Could not find attribute "
"param_distributions."
)
print(
logger.warning(
"Warning! Using subclass BaseSearchCV other than "
"{GridSearchCV, RandomizedSearchCV}. "
"Should implement param check. "
Expand Down
1 change: 0 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
# exploiting the fact that conftest.py always resides in the root directory for tests
static_dir = os.path.dirname(os.path.abspath(__file__))
logger.info("static directory: {}".format(static_dir))
print("static directory: {}".format(static_dir))
while True:
if "openml" in os.listdir(static_dir):
break
Expand Down
4 changes: 3 additions & 1 deletion tests/test_datasets/test_dataset_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -1160,7 +1160,9 @@ def test_publish_fetch_ignore_attribute(self):
except Exception as e:
# returned code 273: Dataset not processed yet
# returned code 362: No qualities found
print("Failed to fetch dataset:{} with '{}'.".format(dataset.id, str(e)))
TestBase.logger.error(
"Failed to fetch dataset:{} with '{}'.".format(dataset.id, str(e))
)
time.sleep(10)
continue
if downloaded_dataset is None:
Expand Down
6 changes: 4 additions & 2 deletions tests/test_study/test_study_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,12 @@ def test_Figure1a(self):
clf, task, avoid_duplicate_runs=False
) # run classifier on splits (requires API key)
score = run.get_metric_fn(sklearn.metrics.accuracy_score) # print accuracy score
print("Data set: %s; Accuracy: %0.2f" % (task.get_dataset().name, score.mean()))
TestBase.logger.info(
"Data set: %s; Accuracy: %0.2f" % (task.get_dataset().name, score.mean())
)
run.publish() # publish the experiment on OpenML (optional)
TestBase._mark_entity_for_removal("run", run.run_id)
TestBase.logger.info(
"collected from {}: {}".format(__file__.split("/")[-1], run.run_id)
)
print("URL for run: %s/run/%d" % (openml.config.server, run.run_id))
TestBase.logger.info("URL for run: %s/run/%d" % (openml.config.server, run.run_id))