Skip to main content

Small CLI to help users migrate from plenoptic 1.x to 2.0

Project description

plenoptic-migrate

Migrate from plenoptic 1.x to 2.0.

Rewrites all occurrences of old API names to their new equivalents, in-place, for each file passed as a command-line argument. After rewriting, reports any deprecated usages that could not be automatically resolved and must be updated manually.

This tool only changes fully resolvable plenoptic objects. For example, it will replace plenoptic.synth.Metamer with plenoptic.Metamer, but will not touch from plenoptic.synthesize import Metamer.

We overwrite all files in-place. We therefore recommend that you track your files using git or make use of the --backup-dir option to create a backup. You are then encouraged to double-check all the changes! This tool worked for the developers of plenoptic but has not been tested on a wide variety of setups.

Installation

The recommended way to use the tool is via uvx or pipx, both of which will create a temporary isolated virtual environment for the tool:

$ pipx run plenoptic-migrate --help

or

$ uvx plenoptic-migrate --help

Module aliases

The tool handles the standard module aliases used in plenoptic's tutorials and examples:

import plenoptic as po
import plenoptic.synthesize as synth
import plenoptic.simulate as simul

Non-standard aliases (e.g. import plenoptic as plen) are not handled and must be updated manually.

Usage:

$ plenoptic-migrate [OPTIONS] PATHS...

Arguments:

  • PATHS...: Directory or text files to update (e.g., .py scripts, .ipynb notebooks, .md files). Non-text files will be skipped. [required]

Options:

  • --backup-dir PATH: Path where we will create a directory to copy existing paths into. Must not exist.
  • --help: Show this message and exit.

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

plenoptic_migrate-0.1.0.tar.gz (9.1 kB view details)

Uploaded Source

Built Distribution

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

plenoptic_migrate-0.1.0-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

Details for the file plenoptic_migrate-0.1.0.tar.gz.

File metadata

  • Download URL: plenoptic_migrate-0.1.0.tar.gz
  • Upload date:
  • Size: 9.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for plenoptic_migrate-0.1.0.tar.gz
Algorithm Hash digest
SHA256 917f1388c8d2b32e2291ac63e25d581388e7409db4f6902b2697ff5f66c7bc82
MD5 158611882663ec5c5c65de87743bc10f
BLAKE2b-256 2340cdc46be5a3d07e4740312748b07aad5cb6c7d82580b54cf5093c2eed3bcb

See more details on using hashes here.

Provenance

The following attestation bundles were made for plenoptic_migrate-0.1.0.tar.gz:

Publisher: deploy.yml on plenoptic-org/plenoptic-migrate

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

File details

Details for the file plenoptic_migrate-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for plenoptic_migrate-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0c39d19669369ce5e77aa779a53186d4c477498b4f4dbdd7511a8d92b2098a0e
MD5 8b29047cf92db3b8a3ab02ed4e9483ae
BLAKE2b-256 fc10dec32b77b3270a0ad73af2dfb5c497990e452ac94e9837d2919824f997a0

See more details on using hashes here.

Provenance

The following attestation bundles were made for plenoptic_migrate-0.1.0-py3-none-any.whl:

Publisher: deploy.yml on plenoptic-org/plenoptic-migrate

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