Reference#

agentbx#

AgentBX: Crystallographic data processing and analysis framework.

class agentbx.Bundle(bundle_type, bundle_id=None)[source]#

Bases: ABC

Base class for data bundles in agentbx.

Bundles are containers that hold related data assets and metadata. Each bundle has a specific type and can contain multiple named assets.

Parameters:
__init__(bundle_type, bundle_id=None)[source]#

Initialize bundle.

Parameters:
  • bundle_type (str) – Type identifier for this bundle

  • bundle_id (Optional[str]) – Optional custom ID

add_asset(name, asset)[source]#

Add an asset to the bundle.

Parameters:
  • name (str) – Asset name

  • asset (Any) – Asset data

Return type:

None

get_asset(name)[source]#

Get an asset from the bundle.

Parameters:

name (str) – Asset name

Returns:

Asset data

Raises:

KeyError – If asset not found

Return type:

Any

has_asset(name)[source]#

Check if bundle has an asset.

Parameters:

name (str) – Asset name

Returns:

True if asset exists

Return type:

bool

remove_asset(name)[source]#

Remove an asset from the bundle.

Parameters:

name (str) – Asset name

Returns:

True if asset was removed, False if not found

Return type:

bool

add_metadata(key, value)[source]#

Add metadata to the bundle.

Parameters:
  • key (str) – Metadata key

  • value (Any) – Metadata value

Return type:

None

get_metadata(key, default=None)[source]#

Get metadata from the bundle.

Parameters:
  • key (str) – Metadata key

  • default (Optional[Any]) – Default value if key not found

Returns:

Metadata value

Return type:

Any

calculate_checksum()[source]#

Calculate checksum of bundle contents.

Returns:

SHA256 checksum (first 16 characters)

Return type:

str

validate()[source]#

Validate bundle contents.

Returns:

True if bundle is valid

Raises:

ValueError – If bundle is invalid

Return type:

bool

get_size_estimate()[source]#

Estimate bundle size in bytes.

Returns:

Estimated size in bytes

Return type:

int

class agentbx.RedisConfig(host='localhost', port=6379, db=0, password=None, max_connections=10, socket_timeout=5, socket_connect_timeout=5, retry_on_timeout=True, health_check_interval=30, default_ttl=3600)[source]#

Bases: object

Redis configuration settings.

Parameters:
  • host (str) –

  • port (int) –

  • db (int) –

  • password (Optional[str]) –

  • max_connections (int) –

  • socket_timeout (int) –

  • socket_connect_timeout (int) –

  • retry_on_timeout (bool) –

  • health_check_interval (int) –

  • default_ttl (int) –

classmethod from_env()[source]#

Create Redis config from environment variables.

Return type:

RedisConfig

__init__(host='localhost', port=6379, db=0, password=None, max_connections=10, socket_timeout=5, socket_connect_timeout=5, retry_on_timeout=True, health_check_interval=30, default_ttl=3600)#
Parameters:
  • host (str) –

  • port (int) –

  • db (int) –

  • password (Optional[str]) –

  • max_connections (int) –

  • socket_timeout (int) –

  • socket_connect_timeout (int) –

  • retry_on_timeout (bool) –

  • health_check_interval (int) –

  • default_ttl (int) –

Return type:

None

class agentbx.AgentConfig(agent_id, redis_config)[source]#

Bases: object

Agent configuration settings.

Parameters:
classmethod from_env(agent_id)[source]#

Create agent config from environment variables.

Parameters:

agent_id (str) –

Return type:

AgentConfig

__init__(agent_id, redis_config)#
Parameters:
Return type:

None

class agentbx.RedisManager(host='localhost', port=6379, db=0, password=None, max_connections=10, socket_timeout=5, socket_connect_timeout=5, retry_on_timeout=True, health_check_interval=30, default_ttl=3600)[source]#

Bases: object

Manages Redis connections and provides high-level operations for agentbx.

Features: - Connection pooling and health checks - Automatic serialization/deserialization of complex objects - Bundle storage and retrieval with metadata - Caching with TTL support - Error handling and retry logic

Parameters:
  • host (str) –

  • port (int) –

  • db (int) –

  • password (Optional[str]) –

  • max_connections (int) –

  • socket_timeout (int) –

  • socket_connect_timeout (int) –

  • retry_on_timeout (bool) –

  • health_check_interval (int) –

  • default_ttl (int) –

__init__(host='localhost', port=6379, db=0, password=None, max_connections=10, socket_timeout=5, socket_connect_timeout=5, retry_on_timeout=True, health_check_interval=30, default_ttl=3600)[source]#

Initialize Redis manager with connection parameters.

Parameters:
  • host (str) – Redis server hostname

  • port (int) – Redis server port

  • db (int) – Redis database number

  • password (Optional[str]) – Redis password (if required)

  • max_connections (int) – Maximum connections in pool

  • socket_timeout (int) – Socket timeout in seconds

  • socket_connect_timeout (int) – Connection timeout in seconds

  • retry_on_timeout (bool) – Whether to retry on timeout

  • health_check_interval (int) – Health check interval in seconds

  • default_ttl (int) – Default TTL for cached items in seconds

is_healthy()[source]#

Check if Redis connection is healthy.

Return type:

bool

store_bundle(bundle, bundle_id=None)[source]#

Store a bundle in Redis.

Parameters:
  • bundle (Any) – Bundle object to store

  • bundle_id (Optional[str]) – Optional custom ID, auto-generated if None

Returns:

Bundle ID

Return type:

str

Raises:

ConnectionError – If Redis connection is not healthy.

get_bundle(bundle_id)[source]#

Retrieve a bundle from Redis.

Parameters:

bundle_id (str) – Bundle ID to retrieve

Returns:

Deserialized bundle object

Return type:

Any

Raises:
delete_bundle(bundle_id)[source]#

Delete a bundle from Redis.

Parameters:

bundle_id (str) – ID of bundle to delete

Returns:

True if deleted, False if not found

Return type:

bool

Raises:

ConnectionError – If Redis connection is not healthy.

list_bundles(bundle_type=None)[source]#

List all bundle IDs, optionally filtered by type.

Parameters:

bundle_type (Optional[str]) – Optional bundle type filter

Returns:

List of bundle IDs

Return type:

list[str]

Raises:

ConnectionError – If Redis connection is not healthy.

cache_get(key)[source]#

Get value from cache.

Parameters:

key (str) – Cache key

Returns:

Cached value or None if not found

Return type:

Any

cache_set(key, value, ttl=None)[source]#

Set value in cache.

Parameters:
  • key (str) – Cache key

  • value (Any) – Value to cache

  • ttl (Optional[int]) – Time to live in seconds (uses default if None)

Returns:

True if successful

Return type:

bool

close()[source]#

Close Redis connection.

Return type:

None

get_bundle_metadata(bundle_id)[source]#

Get metadata for a specific bundle.

Parameters:

bundle_id (str) – Bundle ID to retrieve metadata for

Returns:

Bundle metadata

Return type:

dict

Raises:
list_bundles_with_metadata(bundle_type=None)[source]#

List all bundles with their metadata, optionally filtered by type.

Parameters:

bundle_type (Optional[str]) – Optional bundle type filter

Returns:

List of bundle metadata dictionaries

Return type:

list[dict]

Raises:

ConnectionError – If Redis connection is not healthy.

inspect_bundle(bundle_id)[source]#

Get comprehensive information about a bundle including metadata and content summary.

Parameters:

bundle_id (str) – Bundle ID to inspect

Returns:

Comprehensive bundle information

Return type:

dict

Raises:

ConnectionError – If Redis connection is not healthy.

agentbx.main()[source]#

Main entry point for the CLI.

Return type:

None

Core Modules#

Redis Manager#

Redis manager for agentbx - handles connections, serialization, and caching.

class agentbx.core.redis_manager.RedisManager(host='localhost', port=6379, db=0, password=None, max_connections=10, socket_timeout=5, socket_connect_timeout=5, retry_on_timeout=True, health_check_interval=30, default_ttl=3600)[source]#

Bases: object

Manages Redis connections and provides high-level operations for agentbx.

Features: - Connection pooling and health checks - Automatic serialization/deserialization of complex objects - Bundle storage and retrieval with metadata - Caching with TTL support - Error handling and retry logic

Parameters:
  • host (str) –

  • port (int) –

  • db (int) –

  • password (Optional[str]) –

  • max_connections (int) –

  • socket_timeout (int) –

  • socket_connect_timeout (int) –

  • retry_on_timeout (bool) –

  • health_check_interval (int) –

  • default_ttl (int) –

__init__(host='localhost', port=6379, db=0, password=None, max_connections=10, socket_timeout=5, socket_connect_timeout=5, retry_on_timeout=True, health_check_interval=30, default_ttl=3600)[source]#

Initialize Redis manager with connection parameters.

Parameters:
  • host (str) – Redis server hostname

  • port (int) – Redis server port

  • db (int) – Redis database number

  • password (Optional[str]) – Redis password (if required)

  • max_connections (int) – Maximum connections in pool

  • socket_timeout (int) – Socket timeout in seconds

  • socket_connect_timeout (int) – Connection timeout in seconds

  • retry_on_timeout (bool) – Whether to retry on timeout

  • health_check_interval (int) – Health check interval in seconds

  • default_ttl (int) – Default TTL for cached items in seconds

is_healthy()[source]#

Check if Redis connection is healthy.

Return type:

bool

store_bundle(bundle, bundle_id=None)[source]#

Store a bundle in Redis.

Parameters:
  • bundle (Any) – Bundle object to store

  • bundle_id (Optional[str]) – Optional custom ID, auto-generated if None

Returns:

Bundle ID

Return type:

str

Raises:

ConnectionError – If Redis connection is not healthy.

get_bundle(bundle_id)[source]#

Retrieve a bundle from Redis.

Parameters:

bundle_id (str) – Bundle ID to retrieve

Returns:

Deserialized bundle object

Return type:

Any

Raises:
delete_bundle(bundle_id)[source]#

Delete a bundle from Redis.

Parameters:

bundle_id (str) – ID of bundle to delete

Returns:

True if deleted, False if not found

Return type:

bool

Raises:

ConnectionError – If Redis connection is not healthy.

list_bundles(bundle_type=None)[source]#

List all bundle IDs, optionally filtered by type.

Parameters:

bundle_type (Optional[str]) – Optional bundle type filter

Returns:

List of bundle IDs

Return type:

list[str]

Raises:

ConnectionError – If Redis connection is not healthy.

cache_get(key)[source]#

Get value from cache.

Parameters:

key (str) – Cache key

Returns:

Cached value or None if not found

Return type:

Any

cache_set(key, value, ttl=None)[source]#

Set value in cache.

Parameters:
  • key (str) – Cache key

  • value (Any) – Value to cache

  • ttl (Optional[int]) – Time to live in seconds (uses default if None)

Returns:

True if successful

Return type:

bool

close()[source]#

Close Redis connection.

Return type:

None

get_bundle_metadata(bundle_id)[source]#

Get metadata for a specific bundle.

Parameters:

bundle_id (str) – Bundle ID to retrieve metadata for

Returns:

Bundle metadata

Return type:

dict

Raises:
list_bundles_with_metadata(bundle_type=None)[source]#

List all bundles with their metadata, optionally filtered by type.

Parameters:

bundle_type (Optional[str]) – Optional bundle type filter

Returns:

List of bundle metadata dictionaries

Return type:

list[dict]

Raises:

ConnectionError – If Redis connection is not healthy.

inspect_bundle(bundle_id)[source]#

Get comprehensive information about a bundle including metadata and content summary.

Parameters:

bundle_id (str) – Bundle ID to inspect

Returns:

Comprehensive bundle information

Return type:

dict

Raises:

ConnectionError – If Redis connection is not healthy.

Base Client#

Base client class for Redis operations.

class agentbx.core.base_client.BaseClient(redis_manager, client_id)[source]#

Bases: ABC

Base class for clients that interact with Redis.

Provides common Redis operations and connection management.

Parameters:
__init__(redis_manager, client_id)[source]#

Initialize base client.

Parameters:
  • redis_manager (RedisManager) – Redis manager instance

  • client_id (str) – Unique identifier for this client

store_bundle(bundle, bundle_id=None)[source]#

Store a bundle in Redis.

Parameters:
Return type:

str

get_bundle(bundle_id)[source]#

Retrieve a bundle from Redis.

Parameters:

bundle_id (str) –

Return type:

Any

delete_bundle(bundle_id)[source]#

Delete a bundle from Redis.

Parameters:

bundle_id (str) –

Return type:

bool

list_bundles(bundle_type=None)[source]#

List all bundles, optionally filtered by type.

Parameters:

bundle_type (Optional[str]) –

Return type:

list[str]

cache_get(key)[source]#

Get value from cache.

Parameters:

key (str) –

Return type:

Any

cache_set(key, value, ttl=None)[source]#

Set value in cache.

Parameters:
Return type:

bool

get_client_info()[source]#

Get information about this client.

Return type:

Dict[str, Any]

Bundle Base#

Base bundle class for agentbx data containers.

class agentbx.core.bundle_base.Bundle(bundle_type, bundle_id=None)[source]#

Bases: ABC

Base class for data bundles in agentbx.

Bundles are containers that hold related data assets and metadata. Each bundle has a specific type and can contain multiple named assets.

Parameters:
__init__(bundle_type, bundle_id=None)[source]#

Initialize bundle.

Parameters:
  • bundle_type (str) – Type identifier for this bundle

  • bundle_id (Optional[str]) – Optional custom ID

add_asset(name, asset)[source]#

Add an asset to the bundle.

Parameters:
  • name (str) – Asset name

  • asset (Any) – Asset data

Return type:

None

get_asset(name)[source]#

Get an asset from the bundle.

Parameters:

name (str) – Asset name

Returns:

Asset data

Raises:

KeyError – If asset not found

Return type:

Any

has_asset(name)[source]#

Check if bundle has an asset.

Parameters:

name (str) – Asset name

Returns:

True if asset exists

Return type:

bool

remove_asset(name)[source]#

Remove an asset from the bundle.

Parameters:

name (str) – Asset name

Returns:

True if asset was removed, False if not found

Return type:

bool

add_metadata(key, value)[source]#

Add metadata to the bundle.

Parameters:
  • key (str) – Metadata key

  • value (Any) – Metadata value

Return type:

None

get_metadata(key, default=None)[source]#

Get metadata from the bundle.

Parameters:
  • key (str) – Metadata key

  • default (Optional[Any]) – Default value if key not found

Returns:

Metadata value

Return type:

Any

calculate_checksum()[source]#

Calculate checksum of bundle contents.

Returns:

SHA256 checksum (first 16 characters)

Return type:

str

validate()[source]#

Validate bundle contents.

Returns:

True if bundle is valid

Raises:

ValueError – If bundle is invalid

Return type:

bool

get_size_estimate()[source]#

Estimate bundle size in bytes.

Returns:

Estimated size in bytes

Return type:

int

Agents#

Base Agent#

Structure Factor Agent#

Target Agent#

Gradient Agent#

Experimental Data Agent#

Utilities#

Crystallographic Utils#

Data Analysis Utils#

Utilities for analyzing crystallographic data and structure factors.

agentbx.utils.data_analysis_utils.analyze_complex_data(data, name='data')[source]#

Analyze complex data and return comprehensive statistics.

Parameters:
  • data (Any) – Complex data array (CCTBX flex array or numpy array)

  • name (str) – Name of the data for logging

Returns:

Dictionary with analysis results

Return type:

Dict[str, Any]

agentbx.utils.data_analysis_utils.analyze_miller_array(miller_array, name='miller_array')[source]#

Analyze a CCTBX miller array and return comprehensive statistics.

Parameters:
  • miller_array (Any) – CCTBX miller array

  • name (str) – Name of the array for logging

Returns:

Dictionary with analysis results

Return type:

Dict[str, Any]

agentbx.utils.data_analysis_utils.analyze_bundle(bundle)[source]#

Analyze a bundle and return comprehensive information about its contents.

Parameters:

bundle (Any) – Bundle object

Returns:

Dictionary with bundle analysis

Return type:

Dict[str, Any]

agentbx.utils.data_analysis_utils.print_analysis_summary(analysis, indent=0)[source]#

Print a formatted summary of analysis results.

Parameters:
  • analysis (Dict[str, Any]) – Analysis results dictionary

  • indent (int) – Indentation level for formatting

Return type:

None

agentbx.utils.data_analysis_utils.compare_structure_factors(f_calc, f_obs, name_prefix='')[source]#

Compare calculated and observed structure factors.

Parameters:
  • f_calc (Any) – Calculated structure factors (miller array)

  • f_obs (Any) – Observed structure factors (miller array)

  • name_prefix (str) – Prefix for naming in output

Returns:

Dictionary with comparison results

Return type:

Dict[str, Any]

Redis Utils#

Redis utility functions for agentbx.

agentbx.utils.redis_utils.inspect_bundles_cli()[source]#

CLI tool to inspect bundles in Redis.

CLI Utils#

Command-line interface for agentbx utilities.

agentbx.utils.cli.main()[source]#

Main entry point for the CLI.

Return type:

None

Schemas#

Schema Generator#

Schema generator for agentbx.

This module generates Pydantic schemas from YAML definitions.

class agentbx.schemas.generator.AssetDefinition(*args, **kwargs)[source]#

Bases: BaseModel

Pydantic model for individual asset definitions from YAML.

Parameters:
  • args (Any) –

  • kwargs (Any) –

Return type:

Any

class agentbx.schemas.generator.ValidationRule(*args, **kwargs)[source]#

Bases: BaseModel

Pydantic model for validation rules from YAML.

Parameters:
  • args (Any) –

  • kwargs (Any) –

Return type:

Any

class agentbx.schemas.generator.WorkflowPattern(*args, **kwargs)[source]#

Bases: BaseModel

Pydantic model for workflow patterns from YAML.

Parameters:
  • args (Any) –

  • kwargs (Any) –

Return type:

Any

class agentbx.schemas.generator.SchemaDefinition(*args, **kwargs)[source]#

Bases: BaseModel

Complete schema definition parsed from YAML.

Parameters:
  • args (Any) –

  • kwargs (Any) –

Return type:

Any

class agentbx.schemas.generator.SchemaGenerator(schema_dir)[source]#

Bases: object

Generates Pydantic models from YAML schema definitions.

Parameters:

schema_dir (Path) –

__init__(schema_dir)[source]#
Parameters:

schema_dir (Path) –

load_schema(schema_file)[source]#

Load and parse a single YAML schema file.

Parameters:

schema_file (Path) –

Return type:

SchemaDefinition

load_all_schemas()[source]#

Load all YAML schema files from the schema directory.

Return type:

None

generate_asset_model(asset_name, asset_def)[source]#

Generate Pydantic field definition for an asset.

Parameters:
Return type:

str

generate_validators(schema)[source]#

Generate custom validators for CCTBX-specific validation.

Parameters:

schema (SchemaDefinition) –

Return type:

List[str]

generate_bundle_model(schema)[source]#

Generate a complete Pydantic model for a bundle type.

Parameters:

schema (SchemaDefinition) –

Return type:

str

generate_all_models()[source]#

Generate Pydantic models for all loaded schemas.

Return type:

str

write_generated_models(output_file)[source]#

Write generated models to a Python file.

Parameters:

output_file (Path) –

Return type:

None

agentbx.schemas.generator.main()[source]#

Main function to auto-generate models from default directories.

Return type:

int

agentbx.schemas.generator.watch_for_changes(generator, schemas_dir, output_file, verbose=False)[source]#

Watch for changes in schema files and auto-regenerate.

Parameters:
  • generator (Any) –

  • schemas_dir (Path) –

  • output_file (Path) –

  • verbose (bool) –

Return type:

None

agentbx.schemas.generator.quick_generate()[source]#

Quick generation using default paths.

Return type:

None

Generated Schemas#

class agentbx.schemas.generated.TargetDataBundle(*args, **kwargs)[source]#

Bases: BaseModel

Target function values computed from structure factors and experimental data

Generated from target_data.yaml

Parameters:
  • args (Any) –

  • kwargs (Any) –

Return type:

Any

validate_target_value()#

Validate Scalar target function value

validate_r_factors()#

Validate Crystallographic R-factors

validate_likelihood_parameters()#

Validate Maximum likelihood alpha and beta parameters

validate_target_gradients_wrt_sf()#

Validate Gradients of target w.r.t structure factors

calculate_checksum()[source]#

Calculate checksum of bundle contents.

Return type:

str

validate_dependencies(available_bundles)[source]#

Validate that all dependencies are satisfied.

Parameters:

available_bundles (Dict[str, pydantic.BaseModel]) –

Return type:

bool

class agentbx.schemas.generated.GradientDataBundle(*args, **kwargs)[source]#

Bases: BaseModel

Gradients of target function w.r.t. atomic parameters via chain rule

Generated from gradient_data.yaml

Parameters:
  • args (Any) –

  • kwargs (Any) –

Return type:

Any

validate_coordinate_gradients()#

Validate Gradients w.r.t. atomic coordinates: dT/d(xyz)

validate_bfactor_gradients()#

Validate Gradients w.r.t. B-factors: dT/d(B)

validate_occupancy_gradients()#

Validate Gradients w.r.t. occupancies: dT/d(occ)

calculate_checksum()[source]#

Calculate checksum of bundle contents.

Return type:

str

validate_dependencies(available_bundles)[source]#

Validate that all dependencies are satisfied.

Parameters:

available_bundles (Dict[str, pydantic.BaseModel]) –

Return type:

bool

class agentbx.schemas.generated.GeometryGradientDataBundle(*args, **kwargs)[source]#

Bases: BaseModel

Geometry gradients computed from CCTBX geometry restraints

Generated from geometry_gradient_data.yaml

Parameters:
  • args (Any) –

  • kwargs (Any) –

Return type:

Any

validate_coordinates()#

Validate Atomic coordinates in Cartesian space

validate_geometric_gradients()#

Validate Gradients of geometry restraints w.r.t. coordinates

validate_restraint_energies()#

Validate Individual restraint energies by type

validate_restraint_counts()#

Validate Number of restraints by type

calculate_checksum()[source]#

Calculate checksum of bundle contents.

Return type:

str

validate_dependencies(available_bundles)[source]#

Validate that all dependencies are satisfied.

Parameters:

available_bundles (Dict[str, pydantic.BaseModel]) –

Return type:

bool

class agentbx.schemas.generated.AgentConfigurationBundle(*args, **kwargs)[source]#

Bases: BaseModel

Agent configuration and capability definitions

Generated from agent_configuration.yaml

Parameters:
  • args (Any) –

  • kwargs (Any) –

Return type:

Any

validate_agent_definition()#

Validate Basic agent definition

validate_capabilities()#

Validate Agent capabilities and their configurations

validate_security_policies()#

Validate Security policies for the agent

calculate_checksum()[source]#

Calculate checksum of bundle contents.

Return type:

str

validate_dependencies(available_bundles)[source]#

Validate that all dependencies are satisfied.

Parameters:

available_bundles (Dict[str, pydantic.BaseModel]) –

Return type:

bool

class agentbx.schemas.generated.MacromoleculeDataBundle(*args, **kwargs)[source]#

Bases: BaseModel

Central macromolecule representation with PDB hierarchy

Generated from macromolecule_data.yaml

Parameters:
  • args (Any) –

  • kwargs (Any) –

Return type:

Any

validate_pdb_hierarchy()#

Validate CCTBX PDB hierarchy with full atomic model information

validate_crystal_symmetry()#

Validate Crystal symmetry (unit cell and space group)

validate_model_manager()#

Validate MMTBX model manager with geometry restraints

validate_xray_structure()#

Validate X-ray structure derived from PDB hierarchy

calculate_checksum()[source]#

Calculate checksum of bundle contents.

Return type:

str

validate_dependencies(available_bundles)[source]#

Validate that all dependencies are satisfied.

Parameters:

available_bundles (Dict[str, pydantic.BaseModel]) –

Return type:

bool

class agentbx.schemas.generated.XrayAtomicModelDataBundle(*args, **kwargs)[source]#

Bases: BaseModel

Atomic model data for structure factor calculations

Generated from xray_atomic_model_data.yaml

Parameters:
  • args (Any) –

  • kwargs (Any) –

Return type:

Any

validate_xray_structure()#

Validate CCTBX xray.structure object with atomic model

validate_miller_indices()#

Validate Miller indices for structure factor calculation

validate_bulk_solvent_params()#

Validate Bulk solvent correction parameters

calculate_checksum()[source]#

Calculate checksum of bundle contents.

Return type:

str

validate_dependencies(available_bundles)[source]#

Validate that all dependencies are satisfied.

Parameters:

available_bundles (Dict[str, pydantic.BaseModel]) –

Return type:

bool

class agentbx.schemas.generated.ExperimentalDataBundle(*args, **kwargs)[source]#

Bases: BaseModel

Experimental crystallographic data for refinement and validation

Generated from experimental_data.yaml

Parameters:
  • args (Any) –

  • kwargs (Any) –

Return type:

Any

validate_f_obs()#

Validate Observed structure factor amplitudes

validate_r_free_flags()#

Validate Free R flags for cross-validation

validate_sigmas()#

Validate Uncertainties in observed structure factors

calculate_checksum()[source]#

Calculate checksum of bundle contents.

Return type:

str

validate_dependencies(available_bundles)[source]#

Validate that all dependencies are satisfied.

Parameters:

available_bundles (Dict[str, pydantic.BaseModel]) –

Return type:

bool

class agentbx.schemas.generated.AgentSecurityBundle(*args, **kwargs)[source]#

Bases: BaseModel

Agent security and authorization configuration

Generated from agent_security.yaml

Parameters:
  • args (Any) –

  • kwargs (Any) –

Return type:

Any

validate_agent_registration()#

Validate Agent registration and validation information

validate_permissions()#

Validate List of granted permissions for the agent

validate_capabilities()#

Validate Agent capabilities and their schemas

validate_whitelisted_modules()#

Validate Modules the agent is allowed to import and use

calculate_checksum()[source]#

Calculate checksum of bundle contents.

Return type:

str

validate_dependencies(available_bundles)[source]#

Validate that all dependencies are satisfied.

Parameters:

available_bundles (Dict[str, pydantic.BaseModel]) –

Return type:

bool

class agentbx.schemas.generated.RedisStreamsBundle(*args, **kwargs)[source]#

Bases: BaseModel

Redis stream configuration for agent communication

Generated from redis_streams.yaml

Parameters:
  • args (Any) –

  • kwargs (Any) –

Return type:

Any

validate_stream_configuration()#

Validate Configuration for Redis streams

validate_consumer_groups()#

Validate Consumer group configurations

validate_message_schemas()#

Validate JSON schemas for message validation

calculate_checksum()[source]#

Calculate checksum of bundle contents.

Return type:

str

validate_dependencies(available_bundles)[source]#

Validate that all dependencies are satisfied.

Parameters:

available_bundles (Dict[str, pydantic.BaseModel]) –

Return type:

bool

class agentbx.schemas.generated.StructureFactorDataBundle(*args, **kwargs)[source]#

Bases: BaseModel

Computed structure factors from atomic models

Generated from structure_factor_data.yaml

Parameters:
  • args (Any) –

  • kwargs (Any) –

Return type:

Any

validate_f_calc()#

Validate Calculated structure factors from atomic model

validate_f_mask()#

Validate Structure factors from bulk solvent mask

validate_f_model()#

Validate Combined structure factors: scale * (f_calc + k_sol * f_mask)

validate_scale_factors()#

Validate Scaling parameters used in structure factor calculation

calculate_checksum()[source]#

Calculate checksum of bundle contents.

Return type:

str

validate_dependencies(available_bundles)[source]#

Validate that all dependencies are satisfied.

Parameters:

available_bundles (Dict[str, pydantic.BaseModel]) –

Return type:

bool

class agentbx.schemas.generated.CoordinateUpdateBundle(*args, **kwargs)[source]#

Bases: BaseModel

Coordinate update bundle for geometry minimization and agent communication.

Generated from coordinate_update.yaml

Parameters:
  • args (Any) –

  • kwargs (Any) –

Return type:

Any

calculate_checksum()[source]#

Calculate checksum of bundle contents.

Return type:

str

validate_dependencies(available_bundles)[source]#

Validate that all dependencies are satisfied.

Parameters:

available_bundles (Dict[str, pydantic.BaseModel]) –

Return type:

bool