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-1.0.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-1.0.0-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: plenoptic_migrate-1.0.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-1.0.0.tar.gz
Algorithm Hash digest
SHA256 f52e396b317cf79dc6ba3d8ecb4f5a6e0c62f45df8e6344105ce001936ba3007
MD5 a9abd1190099aa76b7c063e1372c12d6
BLAKE2b-256 9e0a95255965538d849de6d9ee9184e6fdc50a1af9dd41f7e76b97eb629f03dc

See more details on using hashes here.

Provenance

The following attestation bundles were made for plenoptic_migrate-1.0.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-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for plenoptic_migrate-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8643ca5bda6a7ebcb4d601c4c22aad47cd0d625f78752c257eab251902c5b78d
MD5 f1399469fc7111a4aa0d78f56fa487dd
BLAKE2b-256 0f79adf723f682619671ffb9cb77d70bbaf65bd15b84436681dd0b8c285f6c07

See more details on using hashes here.

Provenance

The following attestation bundles were made for plenoptic_migrate-1.0.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