![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Next generation TERSE/PROLIX diffraction data compression algorithm
The pyterse python package provides Python bindings for the C++ TERSE/PROLIX(TRPX) compression algorithm scheme (https://github.com/senikm/trpx).
Before using pyterse, ensure your data meets these requirements:
Create a virtual environment:
conda create -n pyterse python pip numpy pillow
Install the package:
pip install pyterse
There are multiple ways to create a Terse object:
import pyterse
# Empty constructor
terse = pyterse.Terse()
# From NumPy array
terse = pyterse.Terse(data) # data can be nD NumPy array or slice
# With custom compression mode
terse = pyterse.Terse(data, pyterse.TerseMode.SIGNED) # Available modes: SIGNED, UNSIGNED, SMALL_UNSIGNED, DEFAULT
Add data to an existing Terse object:
# Append data at the end
terse.push_back(data) # Data must match existing shape (terse.dim())
# Insert at specific position
terse.insert(pos, data) # pos is the frame index
Save and load compressed data:
# Save to file
terse.save('filename.trpx')
# Load from file
loaded_terse = pyterse.Terse.load('filename.trpx')
Decompress data:
# Decompress all data
decompressed_data = terse.prolix()
# Decompress specific frame
frame = terse.at(0)
decompressed_frame = frame.prolix()
# Set metadata for a frame
terse.set_metadata(frame, "metadata string")
# Get metadata from a frame
metadata = terse.metadata(frame)
# Data information
terse.size() # Number of elements per frame
terse.dim() # Dimensions of one frame
terse.number_of_frames() # Number of frames
terse.number_of_bytes() # Size in bytes of compressed data
terse.bits_per_val() # Bits used per value
terse.is_signed() # Whether data is signed
# Data management
terse.erase(pos) # Remove frame at position
terse.shrink_to_fit() # Optimize memory usage
# Compression settings
terse.set_block_size(size) # Set compression block size (before adding frames)
terse.set_fast(bool) # Toggle fast compression mode
terse.set_small(bool) # Toggle small data optimization
terse.set_dop(value) # Set degree of parallelism (0.0 to 1.0)
FAQs
A Python interface for the TRPX compression algorithm
We found that pyterse demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.