Skip to main content

Python Atmospheric Dynamics: Discovery and Learning about Exoplanets. An open-source, user-friendly python frontend of canoe

Project description

Paddle

Python Atmospheric Dynamics: Discovering and Learning about Exoplanets. An open-source, user-friendly Python version of canoe.

Test the package

Testing the package can be done very easily by following the steps below. All we need is to create a python virtual environment, install the package, and run the test script.

  1. Create a python virtual environment

    python -m venv pyenv
    
  2. Install paddle package

    pip install paddle
    
  3. Run test

    cd tests
    python test_saturn_adiabat.py
    

Develop with Docker

You may need to install Docker to compose up and install the package inside a container if your device or operating system does not support certain dependencies. Follow the instructions below to install docker and docker-compose plugin.

  1. Install docker with compose

    curl -fsSL https://get.docker.com | sudo sh
    
  2. Start docker using the command below or open docker desktop if applicable.

    sudo systemctl start docker
    

After installing Docker, you can use the Makefile commands below to manage your docker containers from the terminal. By default, the container will mount the current directory to /paddle inside the container.

Mounting a local directory allows you to edit files on your local machine while running and testing the code inside the container; or use the container as a development environment and sync files to your local machine.

If you want to change the mounted directory, you can create a docker-compose.overrides.yml file based on the provided docker-compose.overrides.yml.tmp template file.

  • Create a docker container

    make up
    
  • Start a docker container (only if previously created)

    make start
    
  • Terminate a docker container

    make down
    
  • Build a new docker image (rarely used)

    make build
    

If you use VSCode, it is recommended to install extensions including Remote Development, Dev Containers and Container Tools for a better development experience within a container.

  1. Install the extensions mentioned above.

  2. Start the container using make up or make start.

  3. Open VSCode and click on the "Containers" icon on the left sidebar. Note that if you have too many extensions installed, the icon may be hidden under the "..." menu.

  4. Right click on the running container named paddle with a green triangle icon (indicating it is running), and select "Attach Visual Studio Code" (see above images). This will open a new VSCode window connected to the container.

  5. Open either the default folder paddle mounted from your local machine, or any custom workspace folder you have set up inside the docker-compose.overrides.yml file. Now you can start developing inside the container as if you were working on your local machine!

For Developers

Follow the steps below to set up your development environment.

  1. Clone the repository

    https://github.com/elijah-mullens/paddle
    
  2. Cache your github credential. This will prevent you from being prompted for your username and password every time you push changes to github.

    git config credential.helper 'cache --timeout=86400'
    
  3. Create a python virtual environment.

    python -m venv .pyenv
    
  4. Install paddle package

    # Install the package normally
    pip install paddle
    
    # [Alternatively] if you want to install in editable mode
    pip install -e .
    
  5. Install pre-commit hook. This will automatically format your code before each commit to ensure consistent code style.

    pip install pre-commit
    pre-commit install
    

Cubed-Sphere Remapping

paddle can remap Snapy stitched cubed-sphere NetCDF outputs to a rectilinear lat-lon grid with TempestRemap-generated offline weights.

See docs/README_REMAP.md for a step-by-step remapping guide, including the real workspace/data example files, 0.5 degree output, variable selection, and TempestRemap cache usage.

Example:

paddle-cs-remap \
  /home/chengcli/scix/workspace/data/sub_neptune_tidallock.out1.00290.nc \
  /home/chengcli/scix/workspace/data/sub_neptune_tidallock.out2.00290.nc \
  remapped.nc \
  --nlat 181 \
  --nlon 360

The remapper treats Snapy outputs as the 2D stitched 3x2 cubed-sphere mosaic written by Snapy's NetCDF output code. Scalar fields are remapped directly. vel1, vel2, vel3 are rotated to geographic vel_east, vel_north, vel_up before remapping.

Install TempestRemap

Preferred option:

conda install -c conda-forge tempest-remap

Helper script:

./scripts/install_tempestremap.sh conda

Source-build fallback:

./scripts/install_tempestremap.sh source "$HOME/.local/tempestremap"
export PATH="$HOME/.local/tempestremap/bin:$PATH"

Troubleshooting

  1. If you have Docker installed but do not have Docker Compose, remove your current Docker installation, which could be docker or docker.io, and re-install it following the guide provided in the Develop with Docker section above.

  2. If you run out of disk space while building the image. You can relocate the default location for container images: Here is a simple recipe:

    1. Generate config (if you don’t already have one):
    sudo mkdir -p /etc/containerd
    containerd config default | sudo tee /etc/containerd/config.toml >/dev/null
    
    1. Edit /etc/containerd/config.toml and set:
    root = "/home/containerd"   # location where you have space
    state = "/run/containerd"
    
    1. Restart
    sudo systemctl restart containerd
    

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

paddle-1.2.14.tar.gz (7.9 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

paddle-1.2.14-py3-none-any.whl (31.4 kB view details)

Uploaded Python 3

File details

Details for the file paddle-1.2.14.tar.gz.

File metadata

  • Download URL: paddle-1.2.14.tar.gz
  • Upload date:
  • Size: 7.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for paddle-1.2.14.tar.gz
Algorithm Hash digest
SHA256 4210213a08d4220a53d1caaa5a5197e1a7b9ab3ec711baa8056800a7eebc9e35
MD5 fe5214bacbef4d29494bd24721ccca5e
BLAKE2b-256 cf6bb89397460f193f89aafccab67995049802c21b46f09f45213b3501222f9a

See more details on using hashes here.

Provenance

The following attestation bundles were made for paddle-1.2.14.tar.gz:

Publisher: cd.yml on elijah-mullens/paddle

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file paddle-1.2.14-py3-none-any.whl.

File metadata

  • Download URL: paddle-1.2.14-py3-none-any.whl
  • Upload date:
  • Size: 31.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for paddle-1.2.14-py3-none-any.whl
Algorithm Hash digest
SHA256 48f5801a1c551e1a2d5d0046a72d3bc1258e2d688e5bee0affca5a740c352c41
MD5 46e5afb0b3f5e35e58a9f8c9337af61a
BLAKE2b-256 043d84cd6864b7ba19287d411aa8a537c951664124d2209b0f61a58e64bf734f

See more details on using hashes here.

Provenance

The following attestation bundles were made for paddle-1.2.14-py3-none-any.whl:

Publisher: cd.yml on elijah-mullens/paddle

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page