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

Uploaded Python 3

File details

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

File metadata

  • Download URL: plenoptic_migrate-0.2.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.2.0.tar.gz
Algorithm Hash digest
SHA256 c84940ac3527f4dc651d0c79827562108e8c75c2516d36c313077b0b585ec080
MD5 11b067c164dce2abd8a4b42965bd45ca
BLAKE2b-256 2a107fca22269758863a3d8be1bbaa97df6ddf9ac8f57b18e2286e1357e21d36

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for plenoptic_migrate-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d8eb751d4a4716decb69135c2eab7262f779b61941b7923c71b7a158ea3f001a
MD5 22bb77530f53bf4d9f4e74d39ab2c6c0
BLAKE2b-256 32ae5e08d228a4d57061d456113bb02f32ff9d002298eb4ce46b4ac451175fa7

See more details on using hashes here.

Provenance

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