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

Model info sanity #368

Merged
merged 3 commits into from Nov 4, 2017
Merged

Model info sanity #368

merged 3 commits into from Nov 4, 2017

Conversation

@halfak
Copy link
Member

@halfak halfak commented Nov 3, 2017

Some improvements to the way that ModelInfo is handled.

  • Fixes key pattern in format_str for ModelInfo
  • Impossible threshold optimizations no longer blow up.
  • Adds ModelInfoLookupError and tests.
for key in path_tree or self.normalize_fields(path_tree):
if hasattr(self[key], "format_str"):
for key in self.normalize_fields(path_tree):
key_val = try_key(key, self)

This comment has been minimized.

@halfak

halfak Nov 3, 2017
Author Member

Note to reviewer, "try_key()" is where the magic happens.

for key in path_tree or self.normalize_fields(path_tree):
if hasattr(self[key], "format_str"):
for key in self.normalize_fields(path_tree):
key_val = try_key(key, self)

This comment has been minimized.

@adamwight

adamwight Nov 4, 2017
Contributor

We no longer test that key_val has .format_str

return d[int(key)]
except ValueError:
raise e
except KeyError:

This comment has been minimized.

@adamwight

adamwight Nov 4, 2017
Contributor

contains could call try_key internally, to ensure consistent logic.

@@ -35,6 +35,7 @@ def test_sts():
print(skewed_sts.format_str({}, threshold_ndigits=3))
print(balanced_sts.format_str({}, threshold_ndigits=3))
print(skewed_sts.format_str({'maximum recall @ precision >= 0.9': {}}))
print(skewed_sts.format_str({'maximum recall @ precision >= 1.1': {}}))

This comment has been minimized.

@adamwight

adamwight Nov 4, 2017
Contributor

O_o

@adamwight adamwight merged commit c30da92 into master Nov 4, 2017
3 checks passed
3 checks passed
Scrutinizer 3 updated code elements
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
@adamwight adamwight deleted the model_info_sanity branch Nov 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.