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

Telemetry changes #205

Merged
merged 3 commits into from
Apr 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Acquisition functions are now their own objects
- `acquisition_function_cls` constructor parameter renamed to `acquisition_function`
- User guide now explains the new objective classes
- Telemetry deactivation warning is only shown to developers

### Removed
- `model_params` attribute from `Surrogate` base class, `GaussianProcessSurrogate` and
Expand Down
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,18 @@ The available groups are:
- `test`: Required for running the tests.
- `dev`: All of the above plus `tox` and `pip-audit`. For code contributors.

## Telemetry
BayBE collects anonymous usage statistics **only** for employees of Merck KGaA,
Darmstadt, Germany and/or its affiliates. The recording of metrics is turned off for
all other users and is impossible due to a VPN block. In any case, the usage statistics
do **not** involve logging of recorded measurements, targets/parameters or their names
or any project information that would allow for reconstruction of details. The user and
host machine names are irreversibly anonymized.
- You can verify the above statements by studying the open-source code in the
`telemetry` module.
- You can always deactivate all telemetry by setting the environment variable
`BAYBE_TELEMETRY_ENABLED` to `false` or `off`. For details please consult
[this page](https://emdgroup.github.io/baybe/_autosummary/baybe.telemetry.html).
Scienfitz marked this conversation as resolved.
Show resolved Hide resolved

## Authors

Expand Down
15 changes: 9 additions & 6 deletions baybe/telemetry.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,12 +221,15 @@ def is_enabled() -> bool:
# any telemetry timeouts or interference for the user in case of unexpected
# errors. Possible ones are for instance ``socket.gaierror`` in case the user
# has no internet connection.
warnings.warn(
f"WARNING: BayBE Telemetry endpoint {_endpoint_url} cannot be reached. "
"Disabling telemetry. The exception encountered was: "
f"{type(ex).__name__}, {ex}",
UserWarning,
)
if os.environ.get(VARNAME_TELEMETRY_USERNAME, "").startswith("DEV_"):
# This warning is only printed for developers to make them aware of
# potential issues
warnings.warn(
f"WARNING: BayBE Telemetry endpoint {_endpoint_url} cannot be reached. "
"Disabling telemetry. The exception encountered was: "
f"{type(ex).__name__}, {ex}",
UserWarning,
)
os.environ[VARNAME_TELEMETRY_ENABLED] = "false"


Expand Down