visualdynamics.core.photos¶
photos
¶
Photos: pictures of the test, riding in the project.
A Photos object is an ordered set of named images — the setup and instrumentation photos a test report leans on. It keeps the file bytes verbatim (PNG or JPEG), so nothing is re-encoded and what went in is exactly what comes out, in the project file and in the report.
Classes:
| Name | Description |
|---|---|
Photos |
Named images, in the order they arrived. |
Classes¶
Photos
¶
Photos(
names: Sequence[str] | None = None,
formats: Sequence[str] | None = None,
images: Sequence[bytes] | None = None,
)
Named images, in the order they arrived.
Setup photographs belong with the data they document — where the
accelerometers went, how the article was hung — so they are a project
object like any other and ride the .vdyn file. The bytes are kept
encoded as they arrived rather than decoded into arrays: a report
embeds them, and re-encoding a JPEG to store it would lose a
generation for nothing.
Attributes:
names: What each photo is called, which is what a report figure
is captioned with.
formats: The encoding of each — 'png', 'jpeg', 'heic'.
images: The encoded bytes, one per photo.
Methods:
| Name | Description |
|---|---|
rename |
Give the photo at |
delete_photos |
Remove the photos at |
add_file |
Add an image file; the name is the file's own stem, deduped. |
plot |
Show these photos, as the app shows them. |
Source code in src/visualdynamics/core/photos.py
Methods:¶
rename
¶
Give the photo at index a new name; names stay unique.
Source code in src/visualdynamics/core/photos.py
delete_photos
¶
Remove the photos at picks (indices).
Source code in src/visualdynamics/core/photos.py
add_file
¶
Add an image file; the name is the file's own stem, deduped.
Returns the name the photo landed under.