Function reference
Convert country climate data to Parquet files.
This package provides functionality to find and convert country climate data, assumed to be stored as CSVs, to Parquet files.
This package contains the functions:
get_data_names()
- Returns names of climate data sources.clim_to_parquet()
- Converts climate data to a single Parquet file.
clim_to_parquet(data_source, dir_from, dir_to, admin_level=None, gadm_version='v410')
Convert country climate data to a Parquet file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data_source
|
str | list[str]
|
A data source or a list of data sources. See available data sources in
|
required |
dir_from
|
(str, Path)
|
Path to the CSV data directory, as a |
required |
dir_to
|
str | Path
|
Path to the output directory where Parquet files will be saved, as a
|
required |
admin_level
|
(int, list[int])
|
GADM admin level as an integer or a list of integers. May have values in the range 0 -- 3. Defaults to 0 indicating country level data. |
None
|
gadm_version
|
str
|
GADM version as a string. Default is "v410" for v4.1.0. No other versions are currently supported. |
'v410'
|
Returns:
Type | Description |
---|---|
None
|
Called for the side effect of converting CSV data files to Parquet files with each admin level combined into a single file where each admin-unit file is vertically concatenated. Existing variables are maintained. Columns E.g. Where admin-level 1 is The special case of country level data is handled by including a column
|
Raises:
Type | Description |
---|---|
ValueError
|
If |
Exception
|
If |
Warns:
Type | Description |
---|---|
UserWarning
|
If no climate files are found in the input directory. |
Source code in src/clim2parquet/__init__.py
Python | |
---|---|
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 |
|
get_data_names()
Get data source names.
Returns:
Type | Description |
---|---|
list[str]
|
A list of data source names. |