-
Notifications
You must be signed in to change notification settings - Fork 0
Migrating from earlier beta versions
To migrate existing scripts, check the following points. It is recommended to use agentic AI tool for this if available.
-
Install name: the distribution on PyPI is now
allsolveinstead ofallsolve-sdk. The Python import remainsimport allsolve. -
Core dependencies:
decoratorsandsetuptoolsare no longer required by the package;python-dotenvis. Optional extras:allsolve[dataframe]andallsolve[full](seepyproject.toml). -
Entry point: the recommended way to authenticate and configure the SDK is
allsolve.Client(), which by default reads a.envfile in the working directory without loading those variables intoos.environ. -
allsolve.setup(...)is still supported; it returns aClientinstance (same credential resolution asClient()). -
Multiple tenants / hosts: the active API client is tracked with a
contextvars.ContextVar. Usewith client:on a secondaryClientto make it current for that block (seeallsolve.client.Client).
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.
-
create_simulation/create_simulation_static/create_simulation_modal/create_simulation_transient(and related helpers):-
mesh_id→mesh: typeMesh | str | None. -
variable_overrides_id→variable_overrides: typeVariableOverrides | str | None.
-
-
copy_simulation:simulation_id: str→simulation: Simulation | str. -
create_computed_region:source_region_ids: list[str]→source_regions: Sequence[Region | str](each entry may be a region or its id).
-
source_region_ids→source_regions, same typing as above.
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.
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.
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 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)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)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):
SolidMechanicsElectricForceSolidMechanicsMagneticForceSolidMechanicsLargeDisplacementAcousticWavesAcousticStructureAcousticWavesAcousticStructureForElasticWaves
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.
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.
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 existProject.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.
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.
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).
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.
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.
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_idsAfter:
fields = physics.fields
ids = [f.id for f in fields]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.
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() 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.
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 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).
The module-level helper function find_by_id(id, objects) in allsolve.simulation.simulation has been removed.