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 catch writing of pcs #442

Merged
merged 4 commits into from
Jun 12, 2018
Merged

FIX catch writing of pcs #442

merged 4 commits into from
Jun 12, 2018

Conversation

mlindauer
Copy link
Contributor

Writing the cs in pcs can fail if not all parameter values of cat parameter are strings. The json format can deal with it. Therefore, I added a catch and try block to prevent SMAC from crashing.

@mlindauer mlindauer requested a review from mfeurer June 4, 2018 14:05
@codecov-io
Copy link

codecov-io commented Jun 4, 2018

Codecov Report

Merging #442 into development will increase coverage by 0.56%.
The diff coverage is 71.42%.

Impacted file tree graph

@@              Coverage Diff               @@
##           development    #442      +/-   ##
==============================================
+ Coverage        86.33%   86.9%   +0.56%     
==============================================
  Files               50      51       +1     
  Lines             3608    4070     +462     
==============================================
+ Hits              3115    3537     +422     
- Misses             493     533      +40
Impacted Files Coverage Δ
smac/utils/io/output_writer.py 77.02% <71.42%> (-1.55%) ⬇️
smac/tae/execute_ta_run_hydra.py 41.86% <0%> (-5.51%) ⬇️
smac/facade/smac_facade.py 91.6% <0%> (-1.18%) ⬇️
smac/facade/psmac_facade.py 83.33% <0%> (ø)
smac/facade/roar_facade.py 97.67% <0%> (+0.9%) ⬆️
smac/smac_cli.py 85.06% <0%> (+1.13%) ⬆️
smac/utils/io/cmd_reader.py 84.7% <0%> (+3.54%) ⬆️
smac/optimizer/pSMAC.py 98% <0%> (+6.1%) ⬆️
smac/facade/hydra_facade.py 78.94% <0%> (+6.63%) ⬆️
smac/utils/util_funcs.py 93.75% <0%> (+8.03%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 63371e1...8671d4c. Read the comment docs.

Copy link
Contributor

@mfeurer mfeurer left a comment

Choose a reason for hiding this comment

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

Interesting issue, could you provide an example? Maybe we can fix this issue on the side of the config space?

new_path = os.path.join(scenario.output_dir_for_this_run, 'configspace.pcs')
self.save_configspace(scenario.cs, new_path, 'pcs_new')
except TypeError:
traceback.print_exc()
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this output should be sent to the logger with level ERROR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

that's what I tried but unfortunately, somehow at some point we try to serialize this class such that we cannot have a logger here.

Copy link
Contributor

Choose a reason for hiding this comment

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

You can use this helper class to make the logger pickleable: https://github.com/automl/SMAC3/blob/development/smac/utils/logging.py

@mlindauer
Copy link
Contributor Author

@mfeurer Ready for merge?

@mfeurer mfeurer merged commit 9936233 into development Jun 12, 2018
@mfeurer mfeurer deleted the FIX/write_cs branch June 12, 2018 16:17
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.

3 participants