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

Profile viewer fixes #486

Merged
merged 9 commits into from
Mar 23, 2022
Original file line number Diff line number Diff line change
Expand Up @@ -548,10 +548,14 @@ <h1 class="no-responsive__title">Hold on! :)</h1>
return column.properties.tags.name
});


Handlebars.registerHelper("alertLIst", function (column) {
let alertListItem = column.map((value) => {
if (value[1][0]) {
return alertListElement(value[0], value[1][0][0], value[1][0][value[1][0].length - 1] === 0 || (failedConstraints++, false))
let alertListValue = value[1].map((cstr)=>{
return alertListElement(value[0],cstr[0],cstr[cstr.length - 1] === 0 || (failedConstraints++, false))
})
return alertListValue.join(' ')
} else {
return alertListElement('', value[0], value[value.length - 1] === 0 || (failedConstraints++, false))
}
Expand All @@ -563,6 +567,7 @@ <h1 class="no-responsive__title">Hold on! :)</h1>
})
return alertListItem.join(' ')
});

}

function openFilter() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ <h1 class="no-responsive__title">Hold on! :)</h1>
const feature = Object.values(column)[1]

if (feature.numberSummary && feature.numberSummary.uniqueCount) {
return feature.numberSummary.uniqueCount.estimate;
return (feature.numberSummary.uniqueCount.estimate/feature.numberSummary.count)*100;
}
return "0";
});
Expand Down
3 changes: 1 addition & 2 deletions src/whylogs/viz/browser_viz.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ def profile_viewer(profiles: List[DatasetProfile] = None, reference_profiles: Li
except ImportError as e:
Compiler = None
logger.debug(str(e))
logger.debug("Unable to load pybars; install pybars3 to load profile from directly from the current session ")

logger.warning("Unable to load pybars; install pybars3 to load profile directly from the current session ")
index_path = os.path.abspath(os.path.join(_MY_DIR, os.pardir, "viewer/templates", "index.html"))
webbrowser.open_new_tab(f"file:{index_path}#")
return None
Expand Down
3 changes: 2 additions & 1 deletion src/whylogs/viz/jupyter_notebook_viz.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ def __get_compiled_template(self, template_name):
except ImportError as e:
Compiler = None
logger.debug(str(e))
logger.debug("Unable to load pybars; install pybars3 to load profile from directly from the current session ")
logger.warning("Unable to load pybars; install pybars3 to load profile directly from the current session ")

with open(template_path, "r") as file_with_template:
source = file_with_template.read()
compiler = Compiler()
Expand Down