Skip to main content

CLI utility to edit and run a ddscat.par file for DDSCAT

Project description

ddscatcli

This script is a command-line utility to edit and run a ddscat.par file for DDSCAT in a reproducible and automated way.

It allows you to:

  • Modify parameters inside a single ddscat.par configuration file (shape, solver, FFT method, dielectric files, wavelength, etc.).
  • Run DDSCAT automatically — serial, MPI, or OpenMP.
  • Create timestamped backups of the original ddscat.par file.
  • Uses environment variables for configuration (no code editing).

Configuration

Set your paths using environment variables:

export DDSCAT_PAR=/path/to/ddscat.par
export DDSCAT_EXE=/path/to/ddscat

Installation

pip install ddscatcli

This installs the ddscatcli command globally.


Requirements

  • Python 3.8>=
  • Standard library only

Usage

  1. Get help and options:

    ddscatcli -h
    
  2. List available shapes:

    ddscatcli -CSHAPE -h
    
  3. Run modes:

    • -dry-run → preview the edits only (no file modification).
    • (no flag) → apply edits to ddscat.par.
    • -run → apply edits and automatically run DDSCAT.
  4. Parallel options:

    • -omp-threads N → set the number of OpenMP threads.
    • -mpi [launcher] -np N → run DDSCAT with MPI (e.g. mpirun, mpiexec, srun).

Examples

Preview edits without modifying:

ddscatcli -CSHAPE ANIRCTNGL -dry-run

Change the shape and run immediately:

ddscatcli -CSHAPE ELLIPSOID -SHPAR "16 8 4" -run

Set OpenMP threads:

ddscatcli -omp-threads 16 -run

Backups

Every modification automatically creates a timestamped backup:

ddscat.par.bak.YYYYMMDD-HHMMSS

Notes

  • Each parameter is matched using its identifying keyword in the ddscat.par file.
  • Supports dielectric and shape overrides via -DIEL, -NCOMP, -SHPAR, etc.
  • DDSCAT must be compiled and installed separately — this tool just wraps it.

License

This project is licensed under the GNU General Public License v3.0 (GPLv3). You are free to use, modify, and share it under the same license.

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

ddscatcli-1.0.0.tar.gz (21.6 kB view details)

Uploaded Source

Built Distribution

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

ddscatcli-1.0.0-py3-none-any.whl (21.7 kB view details)

Uploaded Python 3

File details

Details for the file ddscatcli-1.0.0.tar.gz.

File metadata

  • Download URL: ddscatcli-1.0.0.tar.gz
  • Upload date:
  • Size: 21.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for ddscatcli-1.0.0.tar.gz
Algorithm Hash digest
SHA256 0c65ce83e4f47b62ddfb711d50a6b44a3842d00950df1a6dd1b0b3f7e26494eb
MD5 3a8c966ba35c67808e2219215059c8ce
BLAKE2b-256 08495f0d6433b074e3387dde6bd16edccb5adeeaaeff1e68b23bb394559dc187

See more details on using hashes here.

File details

Details for the file ddscatcli-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: ddscatcli-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 21.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for ddscatcli-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7de30b7251afc5f1de408b94e2077d6c131a338993bf73106662dc0e0ee1aa3b
MD5 6c09abd265230d35793610683981c9bb
BLAKE2b-256 9226c71cdaf92bdb7be4feb320e0d413ded574e5d789acac5a3c4a42a2e150fc

See more details on using hashes here.

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