src/core/common/environment.py
def validate_storm_category(cls, value: EnvInputAttr) -> pd.DataFrame:
        """
        Transforms the input value given for the 'storm_category' parameter
        into a valid 'Environment' attribute.

        Args:
            value (EnvInputAttr): Value assigned to the attribute (Union[pd.DataFrame, Path, str]).

        Raises:
            FileNotFoundError: When the provided value is a non-existent Path.
            NotImplementedError: When the provided value is not supported.

        Returns:
            pd.DataFrame: Validated value.
        """
        if isinstance(value, pd.DataFrame):
            return value
        if isinstance(value, str):
            value = Path(value)
        if isinstance(value, Path):
            if not value.is_file():
                raise FileNotFoundError(value)
            csv_values = pd.read_csv(value, sep="\t")
            csv_values.set_index("year", inplace=True)
            return csv_values
        raise NotImplementedError(f"Validator not available for type {type(value)}")

        Transforms the input value given for the 'storm_category' parameter
        into a valid 'Environment' attribute.

        Args:
            value (EnvInputAttr): Value assigned to the attribute (Union[pd.DataFrame, Path, str]).

        Raises:
            FileNotFoundError: When the provided value is a non-existent Path.
            NotImplementedError: When the provided value is not supported.

        Returns:
            pd.DataFrame: Validated value.
        
Transforms the input value given for the 'storm_category' parameter
into a valid 'Environment' attribute.
Transforms the input value given for the ' storm_category ' parameter into a valid ' Environment ' attribute .
def validate_storm_category(cls, value: EnvInputAttr) -> pd.DataFrame:
        if isinstance(value, pd.DataFrame):
            return value
        if isinstance(value, str):
            value = Path(value)
        if isinstance(value, Path):
            if not value.is_file():
                raise FileNotFoundError(value)
            csv_values = pd.read_csv(value, sep="\t")
            csv_values.set_index("year", inplace=True)
            return csv_values
        raise NotImplementedError(f"Validator not available for type {type(value)}")
def validate_storm_category ( cls , value : EnvInputAttr ) -> pd . DataFrame : if isinstance ( value , pd . DataFrame ) : return value if isinstance ( value , str ) : value = Path ( value ) if isinstance ( value , Path ) : if not value . is_file ( ) : raise FileNotFoundError ( value ) csv_values = pd . read_csv ( value , sep = "\t" ) csv_values . set_index ( "year" , inplace = True ) return csv_values raise NotImplementedError ( f"Validator not available for type {type(value)}" )
Transforms the input value given for the 'storm_category' parameter
into a valid 'Environment' attribute.
Transforms the input value given for the ' storm_category ' parameter into a valid ' Environment ' attribute .
"""
        Transforms the input value given for the 'storm_category' parameter
        into a valid 'Environment' attribute.

        Args:
            value (EnvInputAttr): Value assigned to the attribute (Union[pd.DataFrame, Path, str]).

        Raises:
            FileNotFoundError: When the provided value is a non-existent Path.
            NotImplementedError: When the provided value is not supported.

        Returns:
            pd.DataFrame: Validated value.
        """
None
pd.DataFrame
When the provided value is a non-existent Path.
When the provided value is a non - existent Path .
FileNotFoundError
When the provided value is not supported.
When the provided value is not supported .
NotImplementedError
cls
value
EnvInputAttr
Value assigned to the attribute (Union[pd.DataFrame, Path, str]).
Value assigned to the attribute ( Union [ pd . DataFrame Path str ] ) .