Skip to content

Migrating from earlier beta versions

Asser Lähdemäki edited this page May 19, 2026 · 1 revision

Introduction

To migrate existing scripts, check the following points. It is recommended to use agentic AI tool for this if available.

PyPI Package Rename and Client

  • Install name: the distribution on PyPI is now allsolve instead of allsolve-sdk. The Python import remains import allsolve.
  • Core dependencies: decorators and setuptools are no longer required by the package; python-dotenv is. Optional extras: allsolve[dataframe] and allsolve[full] (see pyproject.toml).
  • Entry point: the recommended way to authenticate and configure the SDK is allsolve.Client(), which by default reads a .env file in the working directory without loading those variables into os.environ.
  • allsolve.setup(...) is still supported; it returns a Client instance (same credential resolution as Client()).
  • Multiple tenants / hosts: the active API client is tracked with a contextvars.ContextVar. Use with client: on a secondary Client to make it current for that block (see allsolve.client.Client).

Unified parameter names: mesh, variable_overrides, source_regions

Several APIs no longer use *_id in the parameter name for mesh and variable overrides. Parameters were renamed and now accept either a domain object or an ID string; the SDK resolves IDs internally.

Project

  • create_simulation / create_simulation_static / create_simulation_modal / create_simulation_transient (and related helpers):
    • mesh_idmesh: type Mesh | str | None.
    • variable_overrides_idvariable_overrides: type VariableOverrides | str | None.
  • copy_simulation: simulation_id: strsimulation: Simulation | str.
  • create_computed_region: source_region_ids: list[str]source_regions: Sequence[Region | str] (each entry may be a region or its id).

ComputedRegion.create

  • source_region_idssource_regions, same typing as above.

Mesh

Added method create_override, which returns MeshInstance.

The SDK now exposes MeshInstance, representing a single mesh instance on the backend (e.g. default instance vs instance tied to a variable-overrides set). MeshInstance contains run etc. methods for controlling the mesh job.

Method abort_all has been added to Mesh.

raise_on_error Replaced by on_error: OnError Enum

The boolean raise_on_error parameter on GeometryBuilder.build(), MeshInstance.run(), Mesh.run(), and Simulation.run() has been replaced with on_error: OnError.

Old New
raise_on_error=False (default) on_error=OnError.IGNORE (default)
raise_on_error=True on_error=OnError.RAISE
(no equivalent) on_error=OnError.STRICT

OnError.RAISE preserves the previous lenient behavior (tolerates PARTIAL_SUCCESS for mesh, tolerates PARTIAL_SUCCESS and ABORTED for simulation). OnError.STRICT raises unless the job status is exactly SUCCESS.

Exception type changed: ValueError is no longer raised on job failure. The new JobError exception (subclass of Exception) is raised instead, with status and status_reason attributes.

Geometry behavior fix: GeometryBuilder.build() previously tolerated ABORTED status. Both OnError.RAISE and OnError.STRICT now require SUCCESS for geometry, since a non-successful geometry cannot be used downstream.

Material API Simplification

Separate isotropic/anisotropic parameters on Project.create_material() have been merged into single parameters that dispatch by type. The old parameter names are removed.

Removed parameters:

Old parameter Replacement
coefficient_of_thermal_expansion_anisotropic Pass a list to coefficient_of_thermal_expansion
dynamic_viscosity_anisotropic Pass a 3×3 matrix to dynamic_viscosity
elasticity_matrix_youngs_modulus_poissons_ratio Pass MaterialProperty.ElasticityMatrixYoungsModulusPoissonsRatio to elasticity_matrix
elasticity_matrix_pressure_shear_velocity Pass MaterialProperty.ElasticityMatrixPressureShearVelocity to elasticity_matrix
electric_conductivity_anisotropic Pass a 3×3 matrix to electric_conductivity
electric_permittivity_anisotropic Pass a 3×3 matrix to electric_permittivity
magnetic_permeability_anisotropic Pass a 3×3 matrix to magnetic_permeability
thermal_conductivity_anisotropic Pass a 3×3 matrix to thermal_conductivity

Before:

project.create_material(
    name="mat",
    thermal_conductivity_anisotropic=[[1, 0, 0], [0, 1, 0], [0, 0, 1]],
    elasticity_matrix_youngs_modulus_poissons_ratio=(
        MaterialProperty.ElasticityMatrixYoungsModulusPoissonsRatio("210e9", "0.3")
    ),
)

After:

project.create_material(
    name="mat",
    thermal_conductivity=[[1, 0, 0], [0, 1, 0], [0, 0, 1]],
    elasticity_matrix=MaterialProperty.ElasticityMatrixYoungsModulusPoissonsRatio("210e9", "0.3"),
)

MeshRefinement Constructor Is Now Keyword-Only

MeshRefinement previously accepted positional arguments (region, max_size). All arguments are now keyword-only, and region is optional (alternative: tags + entity_type).

Before:

MeshRefinement(my_region, 0.1)

After:

MeshRefinement(max_size=0.1, region=my_region)

SolidMechanicsLump.namespace Is Now Required

The namespace parameter on SolidMechanicsLump was previously an optional keyword argument. It is now a required positional argument (after name, before target).

Before:

SolidMechanicsLump(name="lump", target=region)

After:

SolidMechanicsLump(name="lump", namespace="ns", target=region)

Interaction Target Parameters Are Now Required Where Applicable

Several interaction classes changed target (or target_1/target_2) from Region | str | None to Region | str, making the target required. Affected classes include:

  • SolidMechanicsLoad, SolidMechanicsConstraint, SolidMechanicsClamp, SolidMechanicsLump
  • SolidMechanicsThermalExpansion, SolidMechanicsPiezoelectricity
  • SolidMechanicsPressure, SolidMechanicsPrestress, SolidMechanicsSymmetry
  • SolidMechanicsPeriodicity (target_1, target_2)
  • CurrentFlowConstraint, CurrentFlowLumpVICut
  • CurrentFlowPeriodicity (target_1, target_2)
  • AcousticWavesPml, AcousticWavesConstraint, AcousticWavesAbsorbingBoundary
  • AcousticWavesPeriodicity (target_1, target_2)
  • MagneticForce (output)

Interactions that had their target removed (they no longer accept a target):

  • SolidMechanicsElectricForce
  • SolidMechanicsMagneticForce
  • SolidMechanicsLargeDisplacement
  • AcousticWavesAcousticStructure
  • AcousticWavesAcousticStructureForElasticWaves

Extrusion Classes: Required Parameters Are Now Optional

SlantedExtrusion, PathExtrusion, and FlattenAndRebuildExtrusion changed volumes, from_surfaces, to_surfaces, and layers from required positional parameters to optional keyword arguments (defaulting to None / []). New *_entity_ids parameters provide an alternative to region-based selection.

Existing code passing these as positional arguments will continue to work, but code relying on TypeError for missing arguments will no longer catch that.

enabledByOption Runtime Validation

Generated interaction and output constructors now raise ValueError at construction time when a mode-dependent parameter is None but required by the selected mode. Previously these would only fail at the API call. Code that was passing None for conditionally-required parameters and relying on server-side validation will now fail earlier.

ProjectType Enum and type Parameter Removed

The ProjectType enum and the type parameter on Project.create() have been removed. The Project.script_only property is also removed.

Before:

project = allsolve.Project.create(name="p", type=allsolve.ProjectType.SCRIPT_ONLY)
print(project.script_only)

After:

project = allsolve.Project.create(name="p")
# ProjectType and script_only no longer exist

Project.get_all_by_name() Removed

Project.get_all_by_name(name) has been removed. Use Project.get_all() and filter the results, or use Project.get_by_name(name) to find a single project.

Project.get_all() and Project.get_by_name() Signature Changes

Both methods now accept page_size, page, and only_non_api_projects parameters. get_by_name no longer calls a dedicated get_all_by_name internally; it calls get_all() and filters client-side.

Geometry angle Property Renamed to angle1/angle2

On CadCylinder, CadCone, and CadTorus, the single angle property has been replaced by angle1 and angle2. On CadSphere, angle3 has been removed.

Class Removed Replacement
CadCylinder angle angle1, angle2
CadCone angle angle1, angle2
CadTorus angle angle1, angle2
CadSphere angle3 (removed, use angle1 and angle2)

The same rename applies to the corresponding GeometryBuilder helper methods (add_cylinder, add_cone, add_sphere, add_torus, add_disk).

New inner_radius and alignment Properties on Geometry Primitives

CadBox, CadCylinder, CadCone, CadSphere, CadTorus, CadDisk, and CadRectangle gain new optional properties (inner_radius, alignment). These are additive and non-breaking on their own, but import YAML files using the old angle key will fail; use angle1/angle2 instead.

CAD File Import cleanup Default Changed from True to False

All CAD file import classes (CadStepFile, CadIgesFile, CadSatFile, CadBrepFile, CadGds2File) and their GeometryBuilder helper methods now default cleanup=False (previously True). The feature is documented as not yet supported.

Physic.field_ids Replaced by Physic.fields

The Physic.field_ids property (returning List[str]) has been replaced by Physic.fields (returning List[Field]). Access IDs via field.id.

Before:

ids = physics.field_ids

After:

fields = physics.fields
ids = [f.id for f in fields]

FieldInitialization Is Now an SDK Class

FieldInitialization was previously re-exported directly from the raw API (allsolve_rawapi.FieldInitialization). It is now a first-class SDK object (allsolve.FieldInitialization) with a different constructor signature. The Simulation.field_initializations property now returns SDK FieldInitialization objects.

Simulation.run() / Mesh.run() No Longer Raise on PARTIAL_SUCCESS or ABORTED

When raise_on_error=True, Simulation.run() and Mesh.run() previously raised on any status other than SUCCESS. They now also accept PARTIAL_SUCCESS and ABORTED without raising. GeometryBuilder.build() similarly accepts ABORTED.

Export No Longer Uses <placeholder:...> for File Paths

export() now writes raw file paths (e.g., my_file.step) instead of the old <placeholder:my_file.step> format. Use the new download_geometries=True parameter to download geometry files alongside the export.

Simulation Input Files: extra_input_files / Shared-Files API Removed

The OpenAPI spec and generated client no longer expose simulation extraInputFiles or sharedExtraInputFiles, and the dedicated shared-files routes (GetSimulationSharedFiles, UpdateSimulationSharedFiles) are removed. Extra / shared project files are carried only under inputFiles (as SimulationInputFile entries, including type EXTRAINPUTFILE with source_extra_input_file_id in the Python client where applicable). Any hand-written or older generated code that called those endpoints or read those simulation fields must switch to the unified input-files model.

Simulation.files Return Type Changed

Simulation.files previously returned List[InputFile] from the simulation payload’s extra_input_files. It now returns List[SimulationInputFile] from input_files (the same list as get_input_files()). Code that assumed InputFile attributes or only “mesh” style files in this property must be updated to handle SimulationInputFile (and filter by type / source_extra_input_file_id if needed).

find_by_id() Removed from simulation.py

The module-level helper function find_by_id(id, objects) in allsolve.simulation.simulation has been removed.