schrodinger.utils.featureflags.featureflags module

schrodinger.utils.featureflags.featureflags.get_features()[source]

Get the feature flags from site and user state file based on the existence.

Return type

tuple

Returns

tuple of feature dictionaries - site flags, user flags and combined flags

schrodinger.utils.featureflags.featureflags.set_features(features, desired_state)[source]

Enable or Disable the given features.

This also report the given features which are not present in the default state file.

Parameters

features (list or set) – List of features to enable or disable in the user state file.

Returntype

tuple(int, features)

Returns

(number of features changed, list of unknown features)

Raises

ValueError – if json document cannot be parsed.

schrodinger.utils.featureflags.featureflags.get_state_string(state)[source]

Convert the feature state from integer to a string.

Parameters

state (int) – Feature state in integer format.

Returntype

string

Returns

0 => Disabled, 1 => Enabled, -1 => None

schrodinger.utils.featureflags.featureflags.get_env_var_warning()[source]
Returns

If there are conflicting env var settings, return a string with the description. Otherwise, return None.

Rtype str or None

schrodinger.utils.featureflags.featureflags.env_var_feature_flag_is_set()[source]

Return boolean whether SCHRODINGER_FEATURE_FLAGS is set or not

schrodinger.utils.featureflags.featureflags.list_features(search='*')[source]

Show all available features from site state file or user state file whichever is accessible when search string is not specified. If search string is given, feature matching the search string will be shown. Otherwise feature whose description match the search string is shown only when state file is accessible.

The function will list the output in following format:

<feature_name> : <Enabled|Disabled>
    <Description if available>
    <User State>    : <Enabled|Disabled|None>
    <Default State> : <Enabled|Disabled>
Parameters

search_string (str) – Optional search string.

schrodinger.utils.featureflags.featureflags.get_nondefault_features() str[source]

Return a string usable as the SCHRODINGER_FEATURE_FLAGS environment variable that includes any non-default settings in either the user settings or site settings, and any user settings that restore non-default site settings to their defaults.

schrodinger.utils.featureflags.featureflags.get_site_nondefaults() Set[str][source]

Return the nondefault feature flags in the site state file.

schrodinger.utils.featureflags.featureflags.get_user_feature_env(feature_const: int, enable: bool = True)[source]

Enable a feature flag and return dict with custom feature flags.

Parameters
  • feature_const (int) – Feature to be enabled/disabled

  • enable (bool) – If True enable, if False disable

Raises

ValueError – If feature is unknown

Return type

dict

Returns

Dict with key SCHRODINGER_FEATURE_FLAGS and all the custom flags as value

schrodinger.utils.featureflags.featureflags.parse_args(argv=None)[source]

Setup code for argument parsing

Params argv

Arguments to parse.

schrodinger.utils.featureflags.featureflags.main(argv=None)[source]