OceanDataStore CLI
Mandatory Arguments
| Long version | Short Version | Description |
|---|---|---|
| action | Specify the action: send_to_zarr, send_to_icechunk, update_zarr, update_icechunk or list. |
|
--filepaths |
-f |
Paths to the files to send or update. |
--credentials |
-c |
Path to the JSON file containing the credentials for the object store. |
--bucket |
-b |
Bucket name. |
Optional Arguments
| Flag | Short Version | Description |
|---|---|---|
--prefix |
-p |
Object prefix (default=None). |
--append-dim |
-ad |
Append dimension (default=time_counter). |
--variables |
-v |
Variables to send (default=None). Default None will send all variables. |
--chunk-strategy |
-cs |
Chunk strategy as a JSON string (default=None). E.g., '{\"time_counter\": 1, \"x\": 100, \"y\": 100}' |
--dask-configuration |
-dc |
Path to the JSON file defining the Dask Local Cluster configuration (default=None). |
--grid-filepath |
-gf |
File path to model grid file containing domain information (default=None). |
--update-coords |
-uc |
Coordinate dimensions to update as a JSON string (default=None). E.g., '{\"nav_lon\": \"glamt\", \"nav_lat\": \"gphit\"}' |
--attributes |
-at |
Attributes to add to the dataset as a JSON string. E.g., '{\"title\": \"my_dataset\"}' |
--zarr-version |
-zv |
Zarr version used to create the zarr store (default=3). Options are 2 (v2) or 3 (v3). |
--branch |
-br |
Branch of Icechunk repository to commit changes to (default=main). |
--commit_message |
-cm |
Commit message to be recorded when committing changes to Icechunk repository. (default="Add new data to my Icechunk repository"). |
--variable-commits |
-vc |
Flag to send variables to Icechunk repository using independent commits. |
--icechunk-configuration |
-ic |
Path to the JSON file defining the Icechunk storage and repository configurations (default=None). |
OceanDataStore Python API
OceanDataStore.cli.send_to_zarr
send_to_zarr(file, bucket, object_prefix, store_credentials_json, variables=None, append_dim='time_counter', grid_filepath=None, update_coords=None, rechunk=None, attrs=None, client=None, dask_config_kwargs=None, dask_cluster_kwargs=None, zarr_version=3)
Write data to new Zarr store in cloud object storage with option of using dask.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file
|
list[str] | str | Dataset
|
Regular expression or list of filepaths to netCDF file(s). Users can also pass a single xarray.Dataset directly. |
required |
bucket
|
str
|
Name of the bucket in the object store. Bucket names can contain only lowercase letters, numbers, dots (.), and hyphens (-). |
required |
object_prefix
|
str
|
Prefix to be added to the object names in the object store. |
required |
store_credentials_json
|
str
|
Path to the JSON file containing the object store credentials. |
required |
variables
|
Optional[list[str]]
|
List of variables to send. If None, all variables will be sent. |
None
|
append_dim
|
str
|
Name of the append dimension, by default "time_counter". |
'time_counter'
|
grid_filepath
|
Optional[str]
|
Path to file containing model grid parameter. |
None
|
update_coords
|
Optional[dict]
|
Dictionary of coordinate variables to update. |
None
|
rechunk
|
Optional[dict]
|
Rechunk strategy dictionary, by default None. |
None
|
attrs
|
Optional[dict]
|
Attributes to add to the dataset. |
None
|
client
|
Optional[Client]
|
Dask Distributed Client. |
None
|
dask_config_kwargs
|
Optional[dict]
|
Dask configuration settings passed to dask.config.set(). Ignored if dask client is provided. |
None
|
dask_cluster_kwargs
|
Optional[dict]
|
Dask cluster configuration settings passed to LocalCluster(). Ignored if dask client is provided. |
None
|
zarr_version
|
int
|
Zarr version to use. |
3
|
Source code in OceanDataStore/cli/zarr.py
484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 | |
OceanDataStore.cli.update_zarr
update_zarr(file, bucket, object_prefix, store_credentials_json, variables=None, append_dim='time_counter', grid_filepath=None, update_coords=None, rechunk=None, attrs=None, client=None, dask_config_kwargs=None, dask_cluster_kwargs=None, zarr_version=3)
Update data in existing Zarr store in cloud object storage with option of using dask.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file
|
list[str] | str | Dataset
|
Regular expression or list of filepaths to netCDF file(s). Users can also pass a single xarray.Dataset directly. |
required |
bucket
|
str
|
Name of the bucket in the object store. Bucket names can contain only lowercase letters, numbers, dots (.), and hyphens (-). |
required |
object_prefix
|
str
|
Prefix to be added to the object names in the object store. |
required |
store_credentials_json
|
str
|
Path to the JSON file containing the object store credentials. |
required |
variables
|
Optional[list[str]]
|
List of variables to send to Zarr stores. If None, all variables will be sent. |
None
|
append_dim
|
str
|
Name of the dimension to append multifile datasets. |
'time_counter'
|
grid_filepath
|
Optional[str]
|
Path to file containing model grid parameter. |
None
|
update_coords
|
Optional[dict]
|
Dictionary of coordinate variables to update. |
None
|
rechunk
|
Optional[dict]
|
Rechunk strategy dictionary. |
None
|
attrs
|
Optional[dict]
|
Attributes to add to the dataset. |
None
|
client
|
Optional[Client]
|
Dask Distributed Client. |
None
|
dask_config_kwargs
|
Optional[dict]
|
Dask configuration settings passed to dask.config.set(). Ignored if dask client is provided. |
None
|
dask_cluster_kwargs
|
Optional[dict]
|
Dask cluster configuration settings passed to LocalCluster(). Ignored if dask client is provided. |
None
|
zarr_version
|
int
|
zarr version to use. |
3
|
Source code in OceanDataStore/cli/zarr.py
738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 | |
OceanDataStore.cli.send_to_icechunk
send_to_icechunk(file, bucket, object_prefix, store_credentials_json, exists=False, group=None, variables=None, append_dim='time_counter', grid_filepath=None, update_coords=None, rechunk=None, attrs=None, branch='main', commit_message='Add new data to my Icechunk repository', variable_commits=False, dask_config_kwargs=None, dask_cluster_kwargs=None, icechunk_config=None)
Write data to new Icechunk repository in cloud object storage with option of using dask.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file
|
list[str] | str | Dataset
|
Regular expression or list of filepaths to netCDF file(s). Users can also pass a single xarray.Dataset directly. |
required |
bucket
|
str
|
Name of the bucket in the object store. Bucket names can contain only lowercase letters, numbers, dots (.), and hyphens (-). |
required |
object_prefix
|
str
|
Prefix to be added to the object names in the object store. |
required |
store_credentials_json
|
str
|
Path to the JSON file containing the object store credentials. |
required |
exists
|
Optional[bool]
|
Whether to write to an existing Icechunk repository or create a new repository. |
False
|
group
|
Optional[str]
|
Group in Icechunk repository to write data to. |
None
|
variables
|
Optional[list[str]]
|
List of variables to send. If None, all variables will be sent. |
None
|
append_dim
|
Optional[str]
|
Name of the dimension to append multifile datasets. |
'time_counter'
|
grid_filepath
|
Optional[str]
|
Path to file containing model grid parameter. |
None
|
update_coords
|
Optional[dict]
|
Dictionary of coordinate variables to update. |
None
|
rechunk
|
Optional[dict]
|
Rechunk strategy dictionary, by default None. |
None
|
attrs
|
Optional[dict]
|
Attributes to add to the dataset. |
None
|
branch
|
Optional[str]
|
Branch on which to write data to IcechunkStore. |
'main'
|
commit_message
|
Optional[str]
|
Commit message when updating the Icechunk repository. |
'Add new data to my Icechunk repository'
|
variable_commits
|
Optional[bool]
|
Whether to write each variable to Icechunk repository using separate commits. |
False
|
dask_config_kwargs
|
Optional[dict]
|
Dask configuration settings passed to dask.config.set(). |
None
|
dask_cluster_kwargs
|
Optional[dict]
|
Dask cluster configuration settings passed to LocalCluster(). |
None
|
icechunk_config
|
Optional[dict]
|
Icechunk repository configuration. |
None
|
Source code in OceanDataStore/cli/icechunk.py
652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 | |
OceanDataStore.cli.update_icechunk
update_icechunk(file, bucket, object_prefix, store_credentials_json, group=None, variables=None, append_dim='time_counter', grid_filepath=None, update_coords=None, rechunk=None, attrs=None, branch='main', commit_message='Update data in my Icechunk repository', dask_config_kwargs=None, dask_cluster_kwargs=None, icechunk_config=None)
Update data in existing Icechunk repository in cloud object storage with option of using dask.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file
|
list[str] | str | Dataset
|
Regular expression or list of filepaths to netCDF file(s). Users can also pass a single xarray.Dataset directly. |
required |
bucket
|
str
|
Name of the bucket in the object store. Bucket names can contain only lowercase letters, numbers, dots (.), and hyphens (-). |
required |
object_prefix
|
str
|
Prefix to be added to the object names in the object store. |
required |
store_credentials_json
|
str
|
Path to the JSON file containing the object store credentials. |
required |
group
|
Optional[str]
|
Group in Icechunk repository to write data to. |
None
|
variables
|
Optional[list[str]]
|
List of variables to send. If None, all variables will be sent. |
None
|
append_dim
|
Optional[str]
|
Name of the dimension to append multifile datasets. |
'time_counter'
|
grid_filepath
|
Optional[str]
|
Path to file containing model grid parameter. |
None
|
update_coords
|
Optional[dict]
|
Dictionary of coordinate variables to update. |
None
|
rechunk
|
Optional[dict]
|
Rechunk strategy dictionary, by default None. |
None
|
attrs
|
Optional[dict]
|
Attributes to add to the dataset. |
None
|
branch
|
Optional[str]
|
Branch on which to write data to IcechunkStore. |
'main'
|
commit_message
|
Optional[str]
|
Commit message when updating the Icechunk repository. |
'Update data in my Icechunk repository'
|
dask_config_kwargs
|
Optional[dict]
|
Dask configuration settings passed to dask.config.set(). |
None
|
dask_cluster_kwargs
|
Optional[dict]
|
Dask cluster configuration settings passed to LocalCluster(). |
None
|
icechunk_config
|
Optional[dict]
|
Icechunk repository configuration. |
None
|
Source code in OceanDataStore/cli/icechunk.py
777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 | |