Skip to content
This repository was archived by the owner on Nov 26, 2022. It is now read-only.
This repository was archived by the owner on Nov 26, 2022. It is now read-only.

Allow users to disable the warning and sleep delay when running an algorithm #493

@samueldg

Description

@samueldg

While looking into some performance bottlenecks in Catalyst, I stumbled onto this line of code: https://github.com/enigmampc/catalyst/blob/90d9e4e2def79b49c32607ce7da349598a117021/catalyst/utils/run_algo.py#L151
which seemed unnecessary.

Cf #283 , and PR #421

However after digging, I found the commit that introduces it (55d1fee), and it does make sense. I understand, and fully agree with, the rationale of warning users that this is in alpha state.

I have a suggestion that would tick all the boxes IMO:

  • satisfies maintainers, who want to warn users of the alpha status of the project;
  • satisfies "power users", who would like to dismiss/disable the warning, which they are obviously OK with;
  • doesn't require users manually patching their local copy of Catalyst;
  • doesn't change the current default behaviour;
  • really simple to implement.

The solution is to have the ability to disable the warning and sleep delay with an environment variable (e.g. $CATALYST_DISABLE_ALPHA_WARNING).

This means the following check:

log.info('Catalyst version {}'.format(catalyst.__version__))
if not os.environ.get('CATALYST_DISABLE_ALPHA_WARNING'):
    log.warn(ALPHA_WARNING_MESSAGE)
    sleep(3)

This option doesn't even need to be documented, if you feel it might have bad consequences, but at least people stumbling on that code/issue can set the env variable themselves and call it a day!

If you're interested in this approach, I'll gladly submit a pull request!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions