CrocoDash.raw_data_access package#

Subpackages#

Submodules#

CrocoDash.raw_data_access.config module#

CrocoDash.raw_data_access.config.category_of_product(product_name)#

Returns the type of function, python or script, the function is

CrocoDash.raw_data_access.config.function_exists(product_name, function_name)#

Check if a function exists for a given product.

CrocoDash.raw_data_access.config.list_functions(product_name)#

Return functions available for a given data product.

CrocoDash.raw_data_access.config.list_products()#

Return a list of available data products.

CrocoDash.raw_data_access.config.load_tables()#

Load data tables from CSV files.

CrocoDash.raw_data_access.config.load_varnames_config()#

Load configuration files.

CrocoDash.raw_data_access.config.product_exists(product_name)#

Check if a product exists.

CrocoDash.raw_data_access.config.type_of_function(product_name, function_name)#

Returns the type of function, python or script, the function is

CrocoDash.raw_data_access.driver module#

Functions to query the data access tables and validate data, as well as request all four segments

class CrocoDash.raw_data_access.driver.ProductFunctionRegistry#

Bases: object

Singleton Class Dynamically loads product functions, validates them, and allows easy execution.

list_importable_functions(product: str)#

Lists available functions for a given product.

load_functions()#

Reads the registry tables, dynamically imports functions, and verifies them.

validate_function(product: str, func_name: str)#

Runs a quick validation of the function (ensures it runs and returns expected output).

verify_data_sufficiency(collected_products: list)#

Check if collected_products are sufficient to run the regional model. collected_products should be a list of products.

CrocoDash.raw_data_access.driver.get_rectangular_segment_info(hgrid: Dataset | Grid)#

This function finds the required segment queries from the hgrid and calls the functions

CrocoDash.raw_data_access.utils module#

CrocoDash.raw_data_access.utils.fill_template(template_path, output_path, **kwargs)#

Reads a template file, fills it with the provided arguments, and writes the filled content to a new file.

Parameters:
  • template_path (str) – Path to the template file.

  • output_path (str) – Path to save the filled template.

  • **kwargs – Key-value pairs for substitution in the template.

CrocoDash.raw_data_access.utils.load_config(config_path: str = 'config.json') dict#

Load a JSON config file.

Parameters:

config_path (str, optional) – Path to the JSON config file. Default is “config.json”.

Returns:

The loaded configuration as a dictionary.

Return type:

dict

CrocoDash.raw_data_access.utils.setup_logger(name)#

This function sets up a logger format for the package. It attaches logger output to stdout (if a handler doesn’t already exist) and formats it in a pretty way!

Parameters:

name (str) – The name of the logger.

Returns:

The logger

Return type:

logging.Logger

Module contents#