input4mips_validation.serialisation#
input4mips_validation.serialisation
#
Serialisation of Python objects to standard data exchange formats
format_date_for_time_range(date, ds_frequency)
#
Format date for providing time-range information
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
date
|
datetime | datetime | datetime64
|
Date to format |
required |
ds_frequency
|
str
|
Frequency of the underlying dataset |
required |
Returns:
| Type | Description |
|---|---|
Formatted date
|
|
Source code in src/input4mips_validation/serialisation.py
json_dumps_cv_style(inp)
#
JSON dump raw data
This ensures that consistent settings can be used for writing of all JSON data.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
inp
|
Any
|
Raw data to dump to JSON |
required |
Returns:
| Type | Description |
|---|---|
JSON form of the raw data, formatted using standard CV form
|
|