Skip to main content

Library for handling physical properties of liquids

Project description

liquidlib

A Python library for modeling and interpolating physical properties of liquids at specified temperatures. This library is particularly useful for laboratory automation and liquid handling systems.

Features

  • Temperature-based interpolation of liquid properties:
    • Vapor pressure
    • Density
    • Surface tension
    • Viscosity
  • Automatic calculation of liquid handling parameters based on physical properties
  • JSON serialization support
  • Comprehensive test coverage

Installation

pip install liquidlib

Usage

Basic Usage

from liquidlib import Liquid

# Create a liquid with properties at 20°C and 25°C
liquid = Liquid(
    vapor_pressure_20c=100,    # Vapor pressure at 20°C
    vapor_pressure_25c=120,    # Vapor pressure at 25°C
    density_20c=1.0,          # Density at 20°C
    density_25c=0.98,         # Density at 25°C
    surface_tension_20c=72,   # Surface tension at 20°C
    surface_tension_25c=70,   # Surface tension at 25°C
    viscosity_20c=1.0,        # Viscosity at 20°C
    viscosity_25c=0.9,        # Viscosity at 25°C
    lab_temperature=22.5      # Current lab temperature
)

# Access interpolated properties
print(f"Density at {liquid._lab_temp}°C: {liquid.density}")
print(f"Viscosity at {liquid._lab_temp}°C: {liquid.viscosity}")

# Get liquid handling parameters
print(f"Aspirate speed: {liquid.handling.aspirate_speed}")
print(f"Dispense speed: {liquid.handling.dispense_speed}")

# Export to JSON
json_data = liquid.to_json()

Custom Handling Parameters

from liquidlib import Liquid, LiquidHandling

# Create custom handling parameters
handling = LiquidHandling(
    trailing_air_gap=2.0,
    blowout=5.0,
    pre_wet=True,
    aspirate_speed=0.8,
    dispense_speed=0.6
)

# Create liquid with custom handling
liquid = Liquid(
    vapor_pressure_20c=100,
    vapor_pressure_25c=120,
    density_20c=1.0,
    density_25c=0.98,
    surface_tension_20c=72,
    surface_tension_25c=70,
    viscosity_20c=1.0,
    viscosity_25c=0.9,
    handling=handling
)

Development

To set up the development environment:

# Clone the repository
git clone https://github.com/yourusername/liquidlib.git
cd liquidlib

# Create and activate virtual environment
python -m venv .venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate

# Install development dependencies
pip install -e ".[dev]"

License

This project is licensed under the MIT License - see the LICENSE file for details.

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

liquidlib-0.1.0.tar.gz (9.5 kB view details)

Uploaded Source

Built Distribution

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

liquidlib-0.1.0-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: liquidlib-0.1.0.tar.gz
  • Upload date:
  • Size: 9.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.0

File hashes

Hashes for liquidlib-0.1.0.tar.gz
Algorithm Hash digest
SHA256 35dcf8f326f50d2632a5917d8ec95f6b02c5289d2bfb167b308c839f209c9ab9
MD5 4f2f04a06ec03d9879445899f91d7269
BLAKE2b-256 49bca0bbf447cec676ec3bd59681c7c9cc0913f5739b3b6488aba13280541e33

See more details on using hashes here.

File details

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

File metadata

  • Download URL: liquidlib-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.0

File hashes

Hashes for liquidlib-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f6baed1a32b9eb224abea61726df000afa7a2da9eddefec64f91be05b15f52d5
MD5 6a75011b49453241f85d060982b9b58c
BLAKE2b-256 6247de2c45b1f1f5419633d66a2f7e3d5604e2ff0d3097f3b412c2d6c25c5bc1

See more details on using hashes here.

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