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
dict
- Returns
Dictionary of feature name and its corresponding json item.
-
schrodinger.utils.featureflags.featureflags.
set_features
(features, enable)[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_user_features
()[source]¶ Return the changes in the user feature flags with respect to the site feature flags, in the format:
+FLAG1 +FLAG2 -FLAG3 ...