dpest.wheat package

Subpackages

Submodules

dpest.wheat.overview module

dpest.wheat.overview.overview(treatment=None, overview_file_path=None, output_path=None, variable_classifications=None, overview_ins_first_line=None, mrk='~', smk='!')[source]

Create a PEST instruction (.ins) file from an OVERVIEW.OUT file based on specified filters.

Args:

treatment (str): The treatment to filter the data. (Required) overview_file_path (str): Path to the OVERVIEW.OUT file to read. (Required) output_path (str, optional): Directory where the generated .ins file will be saved.

Defaults to the current working directory if not provided.

variable_classifications (dict, optional): Mapping of variable names to their respective categories.

Defaults to values from the YAML configuration if not provided.

overview_ins_first_line (str, optional): The first line of the .ins file. Defaults to the value in the YAML configuration. mrk (str, optional): Primary marker delimiter character for the instruction file. Defaults to ‘~’. smk (str, optional): Secondary marker delimiter character for the instruction file. Defaults to ‘!’.

Returns:

pandas.DataFrame: A filtered DataFrame used to generate the .ins file. str: The full path to the generated TPL file (output_new_file_path).

Raises:

ValueError: If any required parameters are missing or invalid. FileNotFoundError: If the OVERVIEW.OUT file cannot be found. Exception: For any other unexpected errors.

dpest.wheat.plantgro module

dpest.wheat.plantgro.plantgro(plantgro_file_path=None, treatment=None, variables=None, output_path=None, variable_classifications=None, plantgro_ins_first_line=None, mrk='~', smk='!')[source]

Create a PEST instructions (.ins) file for time series data.

Args:
  • plantgro_file_path (str): Path to the PlantGro.OUT file

  • treatment (str): Treatment name

  • variables (list): variable or list of variables to process

  • output_path (str, optional): Path to save the output file. If None, uses current working directory.

  • variable_classifications (dict, optional): Mapping of variable names to their respective categories.

    Defaults to values from the YAML configuration if not provided.

  • plantgro_ins_first_line (str, optional): The first line of the .ins file. Defaults to the value in the YAML configuration.

mrk (str, optional): Primary marker delimiter character for the instruction file. Defaults to ‘~’. smk (str, optional): Secondary marker delimiter character for the instruction file. Defaults to ‘!’.

Returns:
  • pandas.DataFrame: A filtered DataFrame used to generate the .ins file.

  • str: The path to the created .ins file.

Raises:
ValueError: If required arguments are missing or if invalid values are encountered in the input data,

such as incorrect parameter formats, missing columns in the overview_observations DataFrame, or invalid output paths.

FileNotFoundError: If the specified CUL file (or other necessary file paths) does not exist or is incorrect. Exception: For any other unexpected errors that occur during the execution of the function,

such as issues with file writing or data processing.

Module contents