Allsolve SDK API Reference
allsolve SDK 0.1.6-beta
Section titled “allsolve SDK 0.1.6-beta”allsolve.import_project
Section titled “allsolve.import_project”Contains a PoC of a convenience import format parser.
import_project
Section titled “import_project”def import_project(file_or_data: str | dict, project_to_modify: Project | None = None) -> ProjectImport a project from a file or a dictionary.
Takes a file in YAML or JSON format, an example with all supported fields etc. is given in example/import_geom/project-format.yaml.
Arguments:
file_or_data- The path to the file to import or a dictionary.project_to_modify- The project to modify. If not provided, a new project is created.
Returns:
The imported project object.
allsolve.material
Section titled “allsolve.material”MaterialProperty Objects
Section titled “MaterialProperty Objects”class MaterialProperty()MaterialProperty is a base class for managing material properties.
Material Objects
Section titled “Material Objects”class Material()Material is a class for managing materials in a project.
@classmethoddef create(cls, name: str, color: str, description: str | None = None, properties: List[MaterialProperty.PhysicalProperty] = [], target_region: Region | None = None, abbreviation: str | None = None, project_id: str | None = None) -> SelfCreate a new material.
@classmethoddef get(cls, material_id: str, project_id: str | None = None) -> SelfGet a material by its ID.
get_all
Section titled “get_all”@classmethoddef get_all(cls, project_id: str | None = None) -> List[Self]Get all materials in a project.
@property@prevent_deleteddef id() -> strGet the ID of the material.
@property@prevent_deleteddef name() -> strGet the name of the material.
@name.setter@prevent_deleteddef name(name: str) -> NoneSet the name of the material. Use save() to commit the change.
description
Section titled “description”@property@prevent_deleteddef description() -> str | NoneGet the description of the material.
description
Section titled “description”@description.setter@prevent_deleteddef description(description: str) -> NoneSet the description of the material. Use save() to commit the change.
@property@prevent_deleteddef color() -> strGet the color of the material.
@color.setter@prevent_deleteddef color(color: str) -> NoneSet the color of the material. Use save() to commit the change.
@property@prevent_deleteddef target() -> str | NoneGet the target of the material.
@target.setter@prevent_deleteddef target(target: str) -> NoneSet the target of the material. Use save() to commit the change.
properties
Section titled “properties”@property@prevent_deleteddef properties() -> List[rawapi.PhysicalProperty]Get the properties of the material.
properties
Section titled “properties”@properties.setter@prevent_deleteddef properties(properties: List[rawapi.PhysicalProperty]) -> NoneSet the properties of the material. Use save() to commit the change.
abbreviation
Section titled “abbreviation”@property@prevent_deleteddef abbreviation() -> str | NoneGet the abbreviation of the material.
abbreviation
Section titled “abbreviation”@abbreviation.setter@prevent_deleteddef abbreviation(abbreviation: str) -> NoneSet the abbreviation of the material. Use save() to commit the change.
@prevent_deleteddef delete() -> NoneDelete the material.
@prevent_deleteddef save() -> NoneExplicitly save the changes to the cloud made by
setting properties name, description, color, and properties.
allsolve.token
Section titled “allsolve.token”allsolve.util
Section titled “allsolve.util”NotInitializedError Objects
Section titled “NotInitializedError Objects”class NotInitializedError(Exception)Exception for when a class or data is not initialized.
DeletedError Objects
Section titled “DeletedError Objects”class DeletedError(Exception)Exception for when an object is deleted.
NotProjectAPIKeyError Objects
Section titled “NotProjectAPIKeyError Objects”class NotProjectAPIKeyError(Exception)Exception for when a project API key is not set.
allsolve.job
Section titled “allsolve.job”Job Objects
Section titled “Job Objects”class Job()Job for a project.
Jobs are created when a geometry or a mesh is processed, or when a simulation is run.
@propertydef id() -> strGet the job ID
get_status
Section titled “get_status”def get_status() -> str | NoneGet the current status of the job.
Returns:
The status of the job.
refresh_status
Section titled “refresh_status”def refresh_status(delay_s: float = DEFAULT_DELAY_S) -> str | NoneRefresh the status of the job from the server.
Arguments:
delay_s- Optional time to wait before refreshing the status
Returns:
The status of the job.
is_running
Section titled “is_running”def is_running(refresh_delay_s: float | None = None) -> boolCheck if the job is still running.
Arguments:
refresh_delay_s- Optional time to wait before checking the status
Returns:
True if the job is still running, False otherwise.
get_logs
Section titled “get_logs”def get_logs(limit: int = 100) -> List[str]Get log messages, starting from where we left off previously
Arguments:
limit- Optional maximum number of logs to retrieve
Returns:
A list of log messages.
print_new_loglines
Section titled “print_new_loglines”def print_new_loglines(file: TextIO = sys.stdout, limit: int = 100) -> NonePrint new log lines to the specified output
Arguments:
file- Optional file to print the logs to.limit- Optional maximum number of logs to retrieve and print.
get_status_reason
Section titled “get_status_reason”def get_status_reason() -> str | NoneGet the reason for the current job status, if available
Returns:
The reason for the current job status, if available.
allsolve.region
Section titled “allsolve.region”RegionOperation Objects
Section titled “RegionOperation Objects”class RegionOperation(Enum)Enum for the RegionOperation.
Region Objects
Section titled “Region Objects”class Region()Region of a geometry.
get_all
Section titled “get_all”@classmethoddef get_all(cls, project_id: str | None = None) -> List[Self]Get all regions in the project.
Arguments:
project_id- The ID of the project. Can be omitted if project API key is used.
Returns:
A list of Region objects.
@classmethoddef create(cls, name: str, entity_type: rawapi.EntityType, entity_tags: List[int], region_rule: rawapi.RegionRule | None = None, project_id: str | None = None) -> SelfCreate a region in the project.
Arguments:
name- The name of the region.entity_type- The type of the entity.entity_tags- The tags of the entity.region_rule- Optional region rule of the region.project_id- The ID of the project. Can be omitted if project API key is used.
Returns:
The created region.
@property@prevent_deleteddef id() -> strGet the ID of the region.
@property@prevent_deleteddef name() -> strGet the name of the region.
entity_tags
Section titled “entity_tags”@property@prevent_deleteddef entity_tags() -> List[int]Get the entity tags of the region.
entity_type
Section titled “entity_type”@property@prevent_deleteddef entity_type() -> rawapi.EntityTypeGet the entity type of the region.
@prevent_deleteddef delete() -> NoneDelete the region.
KeyValueAttributePath Objects
Section titled “KeyValueAttributePath Objects”class KeyValueAttributePath(rawapi.AttributePath)KeyValueAttributePath.
RegionRule Objects
Section titled “RegionRule Objects”class RegionRule(Region)RegionRule.
@classmethoddef create(cls, name: str, entity_type: rawapi.EntityType, attribute_path: rawapi.AttributePath | None = None, bounding_box: rawapi.ExpressionBoundingBox | None = None, min_size: rawapi.ExpressionVector | None = None, max_size: rawapi.ExpressionVector | None = None, project_id: str | None = None) -> SelfCreate a region rule in the project.
Arguments:
name- The name of the region.entity_type- The type of the entity.attribute_path- The attribute path of the region.bounding_box- The bounding box of the region.min_size- The minimum size of the region.max_size- The maximum size of the region.project_id- The ID of the project. Can be omitted if project API key is used.
Returns:
The created region rule.
ComputedRegion Objects
Section titled “ComputedRegion Objects”class ComputedRegion(Region)ComputedRegion.
@classmethoddef create(cls, name: str, entity_type: rawapi.EntityType, operation: rawapi.RegionRuleOperation, source_region_ids: List[str], project_id: str | None = None) -> SelfCreate a computed region in the project.
Arguments:
name- The name of the region.entity_type- The type of the entity.operation- The operation to perform on the source regions.source_region_ids- The IDs of the source regions.project_id- The ID of the project. Can be omitted if project API key is used.
Returns:
The created computed region.
allsolve.simulation.simulation
Section titled “allsolve.simulation.simulation”CPU Objects
Section titled “CPU Objects”class CPU(Enum)Enum for the type of CPU.
Runtime Objects
Section titled “Runtime Objects”class Runtime()Runtime for a simulation.
Script Objects
Section titled “Script Objects”class Script()Script for a simulation.
SolverMode Objects
Section titled “SolverMode Objects”class SolverMode()Solver mode for a simulation.
Simulation Objects
Section titled “Simulation Objects”class Simulation()Simulation of a project.
@classmethoddef get(cls, simulation_id: str, project_id: str | None = None) -> SelfGet a simulation by its ID.
Arguments:
simulation_id- The ID of the simulation.project_id- The ID of the project. Can be omitted if project API key is used.
Returns:
The simulation.
get_all
Section titled “get_all”@classmethoddef get_all(cls, project_id: str | None = None) -> List[Self]Get all simulations in the given project.
Arguments:
project_id- The ID of the project. Can be omitted if project API key is used.
Returns:
A list of simulations.
copy_simulation
Section titled “copy_simulation”@classmethoddef copy_simulation(cls, simulation_id: str, project_id: str | None = None) -> SelfMake a copy of the given simulation identified by its ID. Useful for creating simulations from a template.
Arguments:
simulation_id- The id of the source simulation.project_id- The id of the project where the source and target simulation exist. If project API key is used, this is optional.
Returns:
The copied simulation.
@classmethoddef create(cls, name: str, description: str, max_run_time_minutes: int, solver_mode: rawapi.DistributedSolverMode, mesh_id: str | None = None, variable_overrides_id: str | None = None, project_id: str | None = None) -> SelfCreate a new simulation in the given project.
Arguments:
name- The name of the new simulation.description- The description of the new simulation.max_run_time_minutes- The maximum run time of the simulation.solver_mode- The solver mode of the simulation.mesh_id- The ID of the mesh to use in the simulation.variable_overrides_id- The optional ID of the VariableOverrides to use in the simulation.project_id- The id of the project where the new simulation should be created. If project API key is used, this is optional.
Returns:
The created simulation.
@property@prevent_deleteddef id() -> strGet the ID of the simulation.
@property@prevent_deleteddef name() -> strGet the name of the simulation.
@name.setter@prevent_deleteddef name(name: str) -> NoneSet the name of the simulation.
description
Section titled “description”@property@prevent_deleteddef description() -> str | NoneGet the description of the simulation.
description
Section titled “description”@description.setter@prevent_deleteddef description(description: str) -> NoneSet the description of the simulation.
mesh_id
Section titled “mesh_id”@property@prevent_deleteddef mesh_id() -> str | NoneGet the ID of the mesh used in the simulation.
mesh_id
Section titled “mesh_id”@mesh_id.setter@prevent_deleteddef mesh_id(mesh_id: str) -> NoneSet the ID of the mesh used in the simulation.
max_run_time_minutes
Section titled “max_run_time_minutes”@property@prevent_deleteddef max_run_time_minutes() -> intGet the maximum run time of the simulation.
max_run_time_minutes
Section titled “max_run_time_minutes”@max_run_time_minutes.setter@prevent_deleteddef max_run_time_minutes(max_run_time_minutes: int) -> NoneSet the maximum run time of the simulation.
solver_mode
Section titled “solver_mode”@property@prevent_deleteddef solver_mode() -> rawapi.DistributedSolverModeGet the solver mode of the simulation.
solver_mode
Section titled “solver_mode”@solver_mode.setter@prevent_deleteddef solver_mode(solver_mode: rawapi.DistributedSolverMode) -> NoneSet the solver mode of the simulation.
node_count
Section titled “node_count”@property@prevent_deleteddef node_count() -> int | NoneGet the number of nodes used in the simulation.
node_type
Section titled “node_type”@property@prevent_deleteddef node_type() -> CPUGet the type of nodes used in the simulation.
shared_files
Section titled “shared_files”@property@prevent_deleteddef shared_files() -> List[rawapi.InputFile]Get the shared files used in the simulation.
@property@prevent_deleteddef files() -> List[rawapi.InputFile]Get the files used in the simulation.
variable_overrides
Section titled “variable_overrides”@property@prevent_deleteddef variable_overrides() -> VariableOverrides | NoneGet the variable overrides of the simulation.
variable_overrides
Section titled “variable_overrides”@variable_overrides.setter@prevent_deleteddef variable_overrides(variable_overrides: VariableOverrides | None) -> NoneSet the variable overrides of the simulation.
set_scripts
Section titled “set_scripts”@prevent_deleteddef set_scripts(scripts: List[Script]) -> NoneSet the scripts used in the simulation.
refresh_status
Section titled “refresh_status”@prevent_deleteddef refresh_status(delay_s: float = 1) -> str | NoneRefresh the status of the processing of the simulation.
Arguments:
delay_s- Optional delay in seconds between checking the status of the simulation.
Returns:
The status of the processing of the simulation.
get_status
Section titled “get_status”@prevent_deleteddef get_status() -> str | NoneGet the status of the processing of the simulation.
Returns:
The status of the processing of the simulation.
is_running
Section titled “is_running”@prevent_deleteddef is_running(refresh_delay_s: float | None = None) -> boolCheck if the processing of the simulation is running.
Arguments:
refresh_delay_s- Optional delay in seconds between checking the status of the simulation.
Returns:
True if the simulation is running, False otherwise.
get_status_reason
Section titled “get_status_reason”@prevent_deleteddef get_status_reason() -> str | NoneGet the status reason of the simulation.
Returns:
The status reason of the simulation.
get_logs
Section titled “get_logs”@prevent_deleteddef get_logs(limit: int = 100) -> List[str]Get the logs of the simulation.
Arguments:
limit- Optional maximum number of logs to return.
Returns:
The logs of the simulation.
print_new_loglines
Section titled “print_new_loglines”@prevent_deleteddef print_new_loglines(file: TextIO = sys.stdout, limit: int = 100) -> NonePrint the new log lines of the simulation.
Arguments:
file- Optional file to print the logs to.limit- Optional maximum number of logs to print.
set_runtime
Section titled “set_runtime”@prevent_deleteddef set_runtime(runtime: Runtime) -> NoneSet the runtime of the simulation.
@prevent_deleteddef save() -> NoneExplictly save the changes to the cloud made by set_runtime method
or setting properties name, description, mesh_id, max_run_time_minutes, solver_mode and variable_overrides.
Otherwise the changes are saved automatically when start() is called.
set_shared_files
Section titled “set_shared_files”@prevent_deleteddef set_shared_files(handles: List[rawapi.InputFile]) -> NoneTakes a list of project shared file handles and marks them to be used with this simulation. To remove files, remove them from the list and set again.
Arguments:
handles- List of project shared file handles to use in the simulation
add_file
Section titled “add_file”@prevent_deleteddef add_file(filepath: str) -> rawapi.InputFileAdd the file in the given path to the project as shared file
Arguments:
filepath- path to a file in the local system. If used in a simulation, it is available with its basename.
Returns:
The shared file handle.
add_json_file
Section titled “add_json_file”@prevent_deleteddef add_json_file(name: str, content: dict) -> rawapi.InputFileAdd shared file to the project with the given dictionary serialized into JSON as content.
Arguments:
name- The name for the file during the simulationcontent- dictionary containing your data
Returns:
The shared file handle.
@prevent_deleteddef start() -> NoneStart the simulation.
@prevent_deleteddef abort() -> NoneAbort the simulation.
get_output_csv
Section titled “get_output_csv”@prevent_deleteddef get_output_csv(delimiter=",", refresh: bool = False) -> strGet the output of the simulation in CSV format.
Arguments:
delimiter- The delimiter to use in the CSV file.refresh- Whether to refresh the output data.
Returns:
String containing the output of the simulation in CSV format.
get_output_data
Section titled “get_output_data”@prevent_deleteddef get_output_data(refresh: bool = True) -> SimulationOutputDataReturns the output data of the simulation.
Arguments:
refresh- Whether to refresh the output data.
Returns:
allsolve.sim.SimulationOutputData object
get_output_values
Section titled “get_output_values”@prevent_deleteddef get_output_values(sweep_index: int = 0, refresh: bool = False) -> dictGet the output values of the simulation.
Arguments:
sweep_index- The index of the sweep.refresh- Whether to refresh the output values.
Returns:
The output values of the simulation.
save_output_field
Section titled “save_output_field”@prevent_deleteddef save_output_field(name: str, sweep_index: int = 0, step_index: int | None = None, output_dir: str = "./") -> NoneSave the output field of the simulation.
Arguments:
name- The name of the field to save.sweep_index- The index of the sweep.step_index- The index of the step or None.output_dir- The directory to save the field to.
save_output_mesh
Section titled “save_output_mesh”@prevent_deleteddef save_output_mesh(name: str, sweep_index: int = 0, step_index: int | None = None, output_dir: str = "./") -> NoneSave the output mesh of the simulation.
Arguments:
name- The name of the mesh to save.sweep_index- The index of the sweep.step_index- The index of the step or None.output_dir- The directory to save the mesh to.
save_output_files
Section titled “save_output_files”@prevent_deleteddef save_output_files(filenames: List[str], output_dir: str = "./") -> NoneSave the output files of the simulation.
Arguments:
filenames- The names of the files to save.output_dir- The directory to save the files to.
@prevent_deleteddef copy() -> SelfMake a copy of the simulation. Useful for creating simulations from a template.
Returns:
The copied simulation.
@prevent_deleteddef delete() -> NoneDelete the simulation from the project. After deletion, the Simulation object cannot be used and should be discarded.
allsolve.simulation
Section titled “allsolve.simulation”allsolve.simulation.simulation_output_data
Section titled “allsolve.simulation.simulation_output_data”allsolve.mesh
Section titled “allsolve.mesh”ExtrusionLayerDefinition Objects
Section titled “ExtrusionLayerDefinition Objects”class ExtrusionLayerDefinition()A layer definition for SlantedExtrusion, PathExtrusion and FlattenAndRebuildExtrusion.
Arguments:
relative_height- The relative height of the layer.sublayer_count- The number of sublayers in the layer.
MeshRefinement Objects
Section titled “MeshRefinement Objects”class MeshRefinement()A refinement for a mesh.
Arguments:
region- The region to refine.max_size- The maximum size of the refinement.
SlantedExtrusion Objects
Section titled “SlantedExtrusion Objects”class SlantedExtrusion()A slanted extrusion for a mesh.
Arguments:
volumes- The volumes to extrude.from_surfaces- The surfaces to extrude from.to_surfaces- The surfaces to extrude to.layers- The layers of the extrusion.quadrangles- Whether to use quadrangles for the extrusion.
PathExtrusion Objects
Section titled “PathExtrusion Objects”class PathExtrusion()A path extrusion for a mesh.
Arguments:
volumes- The volumes to extrude.from_surfaces- The surfaces to extrude from.to_surfaces- The surfaces to extrude to.layers- The layers of the extrusion.quadrangles- Whether to use quadrangles for the extrusion.
FlattenAndRebuildExtrusion Objects
Section titled “FlattenAndRebuildExtrusion Objects”class FlattenAndRebuildExtrusion()A flatten and rebuild extrusion for a mesh.
Arguments:
volumes- The volumes to extrude.layers- The layers of the extrusion.quadrangles- Whether to use quadrangles for the extrusion.direction_vector- The direction vector for the extrusion.
MeshExtrusion Objects
Section titled “MeshExtrusion Objects”class MeshExtrusion()A simple extrusion for a mesh.
Arguments:
regions- The regions to extrude.sub_layer_counts- The number of sublayers for each layer.extrusion_overlap_mode- The overlap mode for the extrusion.type- The type of extrusion.
MeshQuality Objects
Section titled “MeshQuality Objects”class MeshQuality(Enum)Enum for the quality of a mesh.
MeshSettings Objects
Section titled “MeshSettings Objects”class MeshSettings()Container for settings that can be configured when creating a mesh.
Mesh Objects
Section titled “Mesh Objects”class Mesh()Mesh of a project geometry.
@classmethoddef create(cls, project_id: str, mesh_settings: MeshSettings | None = None) -> SelfCreate a new mesh in the project.
Arguments:
project_id- The ID of the project to create the mesh in.mesh_settings- Optional settings for the mesh.
Returns:
The created mesh.
@classmethoddef get(cls, mesh_id: str, project_id: str | None = None) -> SelfGet a mesh by its ID.
Arguments:
mesh_id- The ID of the mesh.project_id- The ID of the project. Can be omitted if project API key is used.
Returns:
The mesh.
get_all
Section titled “get_all”@classmethoddef get_all(cls, project_id: str | None = None) -> List[Self]Get all meshes in the project.
Arguments:
project_id- The ID of the project. Can be omitted if project API key is used.
Returns:
A list of Mesh objects.
@property@prevent_deleteddef id() -> strGet the ID of the mesh.
@property@prevent_deleteddef name() -> strGet the name of the mesh.
@name.setter@prevent_deleteddef name(name: str) -> NoneSet the name of the mesh. Use save() to commit the change.
quality
Section titled “quality”@property@prevent_deleteddef quality() -> MeshQualityGet the quality of the mesh.
quality
Section titled “quality”@quality.setter@prevent_deleteddef quality(quality: MeshQuality) -> NoneSet the quality of the mesh. Use save() to commit the change.
node_type
Section titled “node_type”@property@prevent_deleteddef node_type() -> str | NoneGet the node type of the mesh.
node_type
Section titled “node_type”@node_type.setter@prevent_deleteddef node_type(node_type: str) -> NoneSet the node type of the mesh. Use save() to commit the change.
max_run_time_minutes
Section titled “max_run_time_minutes”@property@prevent_deleteddef max_run_time_minutes() -> intGet the maximum run time of the mesh.
max_run_time_minutes
Section titled “max_run_time_minutes”@max_run_time_minutes.setter@prevent_deleteddef max_run_time_minutes(max_run_time_minutes: int) -> NoneSet the maximum run time of the mesh. Use save() to commit the change.
use_mesh_refiner
Section titled “use_mesh_refiner”@property@prevent_deleteddef use_mesh_refiner() -> boolGet whether the mesh uses the mesh refiner.
use_mesh_refiner
Section titled “use_mesh_refiner”@use_mesh_refiner.setter@prevent_deleteddef use_mesh_refiner(use_mesh_refiner: bool) -> NoneSet whether the mesh uses the mesh refiner. Use save() to commit the change.
mesh_size_min
Section titled “mesh_size_min”@property@prevent_deleteddef mesh_size_min() -> float | NoneGet the minimum mesh size of the mesh.
mesh_size_min
Section titled “mesh_size_min”@mesh_size_min.setter@prevent_deleteddef mesh_size_min(mesh_size_min: float) -> NoneSet the minimum mesh size of the mesh. Use save() to commit the change.
mesh_size_max
Section titled “mesh_size_max”@property@prevent_deleteddef mesh_size_max() -> float | NoneGet the maximum mesh size of the mesh.
mesh_size_max
Section titled “mesh_size_max”@mesh_size_max.setter@prevent_deleteddef mesh_size_max(mesh_size_max: float) -> NoneSet the maximum mesh size of the mesh. Use save() to commit the change.
scale_factor
Section titled “scale_factor”@property@prevent_deleteddef scale_factor() -> float | NoneGet the scale factor of the mesh.
scale_factor
Section titled “scale_factor”@scale_factor.setter@prevent_deleteddef scale_factor(scale_factor: float) -> NoneSet the scale factor of the mesh. Use save() to commit the change.
curvature_enhancement
Section titled “curvature_enhancement”@property@prevent_deleteddef curvature_enhancement() -> float | NoneGet the curvature enhancement of the mesh.
curvature_enhancement
Section titled “curvature_enhancement”@curvature_enhancement.setter@prevent_deleteddef curvature_enhancement(curvature_enhancement: float) -> NoneSet the curvature enhancement of the mesh. Use save() to commit the change.
curved_mesh
Section titled “curved_mesh”@property@prevent_deleteddef curved_mesh() -> boolGet whether the mesh is curved.
curved_mesh
Section titled “curved_mesh”@curved_mesh.setter@prevent_deleteddef curved_mesh(curved_mesh: bool) -> NoneSet whether the mesh is curved. Use save() to commit the change.
target_width_to_height_ratio
Section titled “target_width_to_height_ratio”@property@prevent_deleteddef target_width_to_height_ratio() -> float | NoneGet the target width to height ratio of the mesh.
target_width_to_height_ratio
Section titled “target_width_to_height_ratio”@target_width_to_height_ratio.setter@prevent_deleteddef target_width_to_height_ratio(target_width_to_height_ratio: float) -> NoneSet the target width to height ratio of the mesh. Use save() to commit the change.
refinements
Section titled “refinements”@property@prevent_deleteddef refinements() -> List[MeshRefinement] | NoneGet the refinements of the mesh.
refinements
Section titled “refinements”@refinements.setter@prevent_deleteddef refinements(refinements: List[MeshRefinement]) -> NoneSet the refinements of the mesh. Use save() to commit the change.
extrusion
Section titled “extrusion”@property@prevent_deleteddef extrusion() -> MeshExtrusion | NoneGet the extrusion of the mesh.
extrusion
Section titled “extrusion”@extrusion.setter@prevent_deleteddef extrusion(extrusion: MeshExtrusion) -> NoneSet the extrusion of the mesh. Use save() to commit the change.
slanted_extrusions
Section titled “slanted_extrusions”@property@prevent_deleteddef slanted_extrusions() -> List[SlantedExtrusion] | NoneGet the extrusions of the mesh.
set_slanted_extrusions
Section titled “set_slanted_extrusions”@slanted_extrusions.setter@prevent_deleteddef set_slanted_extrusions( slanted_extrusions: List[SlantedExtrusion] | None) -> NoneSet the slanted extrusions of the mesh. Use save() to commit the change.
path_extrusions
Section titled “path_extrusions”@property@prevent_deleteddef path_extrusions() -> List[PathExtrusion] | NoneGet the path extrusions of the mesh.
set_path_extrusions
Section titled “set_path_extrusions”@path_extrusions.setter@prevent_deleteddef set_path_extrusions(path_extrusions: List[PathExtrusion] | None) -> NoneSet the path extrusions of the mesh. Use save() to commit the change.
flatten_and_rebuild_extrusions
Section titled “flatten_and_rebuild_extrusions”@property@prevent_deleteddef flatten_and_rebuild_extrusions() -> List[FlattenAndRebuildExtrusion] | NoneGet the flatten and rebuild extrusions of the mesh.
set_flatten_and_rebuild_extrusions
Section titled “set_flatten_and_rebuild_extrusions”@flatten_and_rebuild_extrusions.setter@prevent_deleteddef set_flatten_and_rebuild_extrusions( flatten_and_rebuild_extrusions: List[FlattenAndRebuildExtrusion] | None) -> NoneSet the flatten and rebuild extrusions of the mesh. Use save() to commit the change.
variable_overrides
Section titled “variable_overrides”@property@prevent_deleteddef variable_overrides() -> List[VariableOverrides] | NoneGet the variable overrides of the mesh.
variable_overrides
Section titled “variable_overrides”@variable_overrides.setter@prevent_deleteddef variable_overrides( variable_overrides: List[VariableOverrides] | None) -> NoneSet the variable overrides of the mesh. Use save() to commit the change.
@prevent_deleteddef save() -> NoneExplicitly save the changes to the cloud made by
setting properties name, quality, node_type, max_run_time_minutes,
mesh_size_min, mesh_size_max, scale_factor, curvature_enhancement,
curved_mesh, refinements and variable_overrides.
@prevent_deleteddef start(variable_overrides_id: str | None = None) -> NoneStart processing the mesh.
Arguments:
variable_overrides_id- Optional VariableOverrides id to use for the mesh.
@prevent_deleteddef run(variable_overrides_id: str | None = None, print_logs: bool = False, refresh_delay_s: float = 1) -> NoneProcess the mesh and returns when the processing is complete.
Arguments:
variable_overrides_id- Optional VariableOverrides id to use for the mesh.print_logs- If True, print logs to the console.refresh_delay_s- Optional delay in seconds between checking the status of the job.
@prevent_deleteddef abort() -> NoneAbort the processing of the mesh.
get_status
Section titled “get_status”@prevent_deleteddef get_status() -> str | NoneGet the status of the processing of the mesh.
Returns:
The status of the processing of the mesh.
is_running
Section titled “is_running”@prevent_deleteddef is_running(refresh_delay_s: float | None = None) -> boolCheck if the processing of the mesh is running.
Arguments:
refresh_delay_s- Optional delay in seconds between checking the status of the job.
Returns:
True if the processing of the mesh is running, False otherwise.
refresh_status
Section titled “refresh_status”@prevent_deleteddef refresh_status(delay_s: float = 1) -> str | NoneRefresh the status of the processing of the mesh.
Arguments:
delay_s- Optional delay in seconds between checking the status of the job.
Returns:
The status of the processing of the mesh.
get_logs
Section titled “get_logs”@prevent_deleteddef get_logs(limit: int = 100) -> List[str]Get the logs of the processing of the mesh.
Arguments:
limit- Optional maximum number of logs to return.
Returns:
The logs of the processing of the mesh.
print_new_loglines
Section titled “print_new_loglines”@prevent_deleteddef print_new_loglines(file: TextIO = sys.stdout, limit: int = 100) -> NonePrint the new log lines of the processing of the mesh.
Arguments:
file- Optional file to print the logs to.limit- Optional maximum number of logs to print.
@prevent_deleteddef delete() -> NoneDelete the mesh from the project.
@prevent_deleteddef copy(name: str | None = None) -> SelfCopy the mesh.
Arguments:
name- Optional name of the new mesh.
Returns:
The copied mesh.
save_mesh_file
Section titled “save_mesh_file”@prevent_deleteddef save_mesh_file(output_dir: str = "./", filename: str = "mesh.msh", variable_overrides_id: str | None = None) -> NoneSave the mesh file to a file on local file system.
By default, the mesh file is saved to the current working directory as
mesh.msh.
Arguments:
output_dir- The optional directory to save the mesh file to.filename- The optional filename to save the mesh file to.variable_overrides_id- The optional variable overrides id to use for the mesh.
allsolve.api
Section titled “allsolve.api”is_setup
Section titled “is_setup”def is_setup() -> boolCheck if the Allsolve API client has been initialized.
def setup(api_key: str, api_secret: str, host="http://localhost:3001")Initialize the Allsolve API client and perform authentication.
Arguments:
api_key- The API key.api_secret- The API secret.host- The host to use.
Raises:
Can raise exception if the authentication request to the Allsolve API fails.
allsolve.file
Section titled “allsolve.file”delete_file
Section titled “delete_file”def delete_file(handle: rawapi.InputFile, project_id: str | None = None) -> NoneDelete a file from the project.
Arguments:
handle- The handle of the file to delete.project_id- The project ID. Can be omitted when using a project API key.
allsolve.geometry
Section titled “allsolve.geometry”GDSUnit Objects
Section titled “GDSUnit Objects”class GDSUnit()GDSUnit describes a unit in GDS2 file.
@propertydef value() -> str | NoneGet the value of the GDS unit.
@value.setterdef value(value: str | None) -> NoneSet the value of the GDS unit.
GDSAbsoluteLayer Objects
Section titled “GDSAbsoluteLayer Objects”class GDSAbsoluteLayer()GDSAbsoluteLayer describes a layer in GDS2 file with thickness and absolute z0.
@propertydef name() -> strGet the name of the layer.
@name.setterdef name(value: str) -> NoneSet the name of the layer.
absolute_z0
Section titled “absolute_z0”@propertydef absolute_z0() -> GDSUnitGet the absolute z0 of the layer.
absolute_z0
Section titled “absolute_z0”@absolute_z0.setterdef absolute_z0(value: GDSUnit) -> NoneSet the absolute z0 of the layer.
disabled
Section titled “disabled”@propertydef disabled() -> boolGet the disabled state of the layer.
disabled
Section titled “disabled”@disabled.setterdef disabled(value: bool) -> NoneSet the disabled state of the layer.
GDSStackedLayer Objects
Section titled “GDSStackedLayer Objects”class GDSStackedLayer()GDSStackedLayer describes a layer in GDS2 file with thickness. Z0 is calculated from previous layers.
@propertydef name() -> strGet the name of the layer.
@name.setterdef name(value: str) -> NoneSet the name of the layer.
thickness
Section titled “thickness”@propertydef thickness() -> GDSUnitGet the thickness of the layer.
thickness
Section titled “thickness”@thickness.setterdef thickness(value: GDSUnit) -> NoneSet the thickness of the layer.
disabled
Section titled “disabled”@propertydef disabled() -> boolGet the disabled state of the layer.
disabled
Section titled “disabled”@disabled.setterdef disabled(value: bool) -> NoneSet the disabled state of the layer.
GDS2ImportConfig Objects
Section titled “GDS2ImportConfig Objects”class GDS2ImportConfig()GDS2ImportConfig holds parameters for importing a geometry from a GDS2 file. Configuration requires an unit and layers defined in absolute or/and stacked order. Each layer should have thickness and a name as defined in the GDS2 file. Absolute layers should have also absolute z0.
@propertydef unit() -> GeometryUnitGet the unit of the GDSImportConfig.
GeometryElement Objects
Section titled “GeometryElement Objects”class GeometryElement()GeometryElement is a base class for importing a geometry to a project.
ImportGeometry Objects
Section titled “ImportGeometry Objects”class ImportGeometry()ImportGeometry is a base class for importing a geometry to a project from a file.
ImportStep Objects
Section titled “ImportStep Objects”class ImportStep(ImportGeometry)ImportStep is a class for importing a STEP file to a project.
ImportIges Objects
Section titled “ImportIges Objects”class ImportIges(ImportGeometry)ImportIges is a class for importing an IGES file to a project.
ImportBrep Objects
Section titled “ImportBrep Objects”class ImportBrep(ImportGeometry)ImportBrep is a class for importing a BREP file to a project.
ImportSat Objects
Section titled “ImportSat Objects”class ImportSat(ImportGeometry)ImportSat is a class for importing a SAT file to a project.
ImportMsh Objects
Section titled “ImportMsh Objects”class ImportMsh(ImportGeometry)ImportMsh is a class for importing a MSH file to a project.
ImportNas Objects
Section titled “ImportNas Objects”class ImportNas(ImportGeometry)ImportNas is a class for importing a NAS file to a project.
ImportGds2 Objects
Section titled “ImportGds2 Objects”class ImportGds2(ImportGeometry)ImportGds2 is a class for importing a GDS2 file to a project.
Geometry Objects
Section titled “Geometry Objects”class Geometry()Geometry for a project.
@classmethoddef create(cls, geometry_imports: List[GeometryElement.ImportGeometry], project_id: str) -> SelfCreate a new geometry element in the given project. Uploads the geometry file to the project.
Arguments:
geometry_imports- A list of geometry import objects. Currently only one geometry import per project is supported.project_id- The id of the project where the new geometry element should be created.
Returns:
The created geometry element.
@classmethoddef get(cls, project_id: str) -> List[Self]Get list of Geometry objects in the given project. Currently only one Geometry per project is supported.
Arguments:
project_id- The ID of the project. Can be omitted if project API key is used.
Returns:
A list of Geometry objects.
delete_geometry
Section titled “delete_geometry”@classmethoddef delete_geometry(cls: type[Self], project_id: str) -> NoneDelete the geometry from the project.
@property@prevent_deleteddef id() -> strGet the ID of the geometry element.
@property@prevent_deleteddef name() -> strGet the name of the geometry element.
file_uploaded_at
Section titled “file_uploaded_at”@property@prevent_deleteddef file_uploaded_at() -> datetime | NoneGet the time the geometry file was uploaded.
@prevent_deleteddef start() -> NoneStart processing the imported geometry file.
@prevent_deleteddef run(print_logs: bool = False, refresh_delay_s: float = 1) -> NoneProcesses the imported geometry file and returns when the processing is complete.
Arguments:
print_logs- If True, print logs to the console.refresh_delay_s- Optional delay in seconds between checking the status of the job.
@prevent_deleteddef abort() -> NoneAbort the processing of the geometry file.
get_status
Section titled “get_status”@prevent_deleteddef get_status() -> str | NoneGet the status of the processing of the geometry file.
Returns:
The status of the processing of the geometry file.
is_running
Section titled “is_running”@prevent_deleteddef is_running(refresh_delay_s: float | None = None) -> boolCheck if the processing of the geometry file is running.
Arguments:
refresh_delay_s- Optional delay in seconds between checking the status of the job.
Returns:
True if the processing of the geometry file is running, False otherwise.
refresh_status
Section titled “refresh_status”@prevent_deleteddef refresh_status(delay_s: float = 1) -> str | NoneRefresh the status of the processing of the geometry file.
Arguments:
delay_s- Optional delay in seconds between checking the status of the job.
Returns:
The status of the processing of the geometry file.
get_logs
Section titled “get_logs”@prevent_deleteddef get_logs(limit: int = 100) -> List[str]Get the logs of the processing of the imported geometry file.
Arguments:
limit- Optional maximum number of logs to return.
Returns:
A list of log messages.
print_new_loglines
Section titled “print_new_loglines”@prevent_deleteddef print_new_loglines(file: TextIO = sys.stdout, limit: int = 100) -> NonePrint the new log lines of the processing of the imported geometry file.
Arguments:
file- Optional file to print the logs to.limit- Optional maximum number of logs to print.
@prevent_deleteddef delete() -> NoneDelete the geometry from the project.
allsolve.expression
Section titled “allsolve.expression”SharedExpression Objects
Section titled “SharedExpression Objects”class SharedExpression()SharedExpression is for managing shared expressions.
The “Shared” means that they are stored in the system so that they can referred to in other places using their identifier.
@classmethoddef create(cls, name: str, expression_type: ExpressionType = ExpressionType.EXPRESSION, description: str = "", expression: Optional[str | float | int] = None, args: Optional[List[ExpressionArg] | List[rawapi.SharedExpressionArg]] = None, values: Optional[List[Union[float, int]]] = None, project_id: str | None = None) -> SelfCreate a new shared expression.
@classmethoddef get(cls, expr_id: str, project_id: str | None = None) -> SelfGet a shared expression by its ID.
get_all
Section titled “get_all”@classmethoddef get_all(cls, project_id: str | None = None) -> List[Self]Get all shared expressions in a project.
@property@prevent_deleteddef id() -> strGet the ID of the shared expression.
@property@prevent_deleteddef name() -> strGet the name of the shared expression.
@name.setter@prevent_deleteddef name(name: str) -> NoneSet the name of the shared expression. Use save() to commit the change.
description
Section titled “description”@property@prevent_deleteddef description() -> strGet the description of the shared expression.
description
Section titled “description”@description.setter@prevent_deleteddef description(description: str) -> NoneSet the description of the shared expression. Use save() to commit the change.
@property@prevent_deleteddef type() -> rawapi.SharedExpressionTypeGet the type of the shared expression.
@type.setter@prevent_deleteddef type(expression_type: rawapi.SharedExpressionType) -> NoneSet the type of the shared expression. Use save() to commit the change.
@property@prevent_deleteddef origin() -> Optional[str]Get the origin (original shared expression ID if this is a copy).
@origin.setter@prevent_deleteddef origin(origin: Optional[str]) -> NoneSet the origin of the shared expression. Use save() to commit the change.
@property@prevent_deleteddef args() -> Optional[List[rawapi.SharedExpressionArg]]Get the arguments of the shared expression.
@args.setter@prevent_deleteddef args(args: Optional[List[rawapi.SharedExpressionArg]]) -> NoneSet the arguments of the shared expression. Use save() to commit the change.
expression
Section titled “expression”@property@prevent_deleteddef expression() -> Optional[str]Get the expression string.
expression
Section titled “expression”@expression.setter@prevent_deleteddef expression(expression: Optional[str]) -> NoneSet the expression string. Use save() to commit the change.
@property@prevent_deleteddef values() -> Optional[List[Union[float, int]]]Get the values of the shared expression.
@values.setter@prevent_deleteddef values(values: Optional[List[Union[float, int]]]) -> NoneSet the values of the shared expression. Use save() to commit the change.
@prevent_deleteddef delete() -> NoneDelete the shared expression.
@prevent_deleteddef save() -> NoneExplicitly save the changes to the cloud made by
setting properties like name, description, type, expression, args, origin and values.
allsolve.project
Section titled “allsolve.project”ProjectType Objects
Section titled “ProjectType Objects”class ProjectType(Enum)Enum for the type of project.
GeometryPipelineVersion Objects
Section titled “GeometryPipelineVersion Objects”class GeometryPipelineVersion(Enum)Enum for the version of the geometry pipeline.
Project Objects
Section titled “Project Objects”class Project()A project in the AllSolve.
from_token
Section titled “from_token”@classmethoddef from_token(cls) -> SelfGet the project associated with the project API key.
Returns:
The project associated with the project API key.
Raises:
NotProjectAPIKeyError- If not authenticated with a project API key.
@classmethoddef get(cls, project_id: str) -> SelfGet a project using the project ID.
Arguments:
project_id- The ID of the project to get.
Returns:
The project with the given ID.
get_all
Section titled “get_all”@classmethoddef get_all(cls) -> List[Self]Get all projects.
Returns:
A list of projects that the authentication has access to.
@classmethoddef create( cls, name: str, description: str, organization_write_access: bool | None = None, labels: List[str] | None = None, type: ProjectType = ProjectType.NORMAL, geometry_pipeline_version: GeometryPipelineVersion = GeometryPipelineVersion .V1) -> SelfCreate a new project.
Arguments:
name- The name of the project.description- The description of the project.organization_write_access- Optional boolean whether the organization has write access to the project.labels- Optional list of labels for the project.type- OptionalProjectType. Default isProjectType.NORMAL. UseProjectType.SCRIPT_ONLYfor projects that do not have geometry.geometry_pipeline_version- Optional GeometryPipelineVersion. Default is V1.
Returns:
The created project.
@property@prevent_deleteddef id() -> strGet the ID of the project.
@property@prevent_deleteddef name() -> strGet the name of the project.
@name.setter@prevent_deleteddef name(name: str) -> NoneSet the name of the project.
description
Section titled “description”@property@prevent_deleteddef description() -> strGet the description of the project.
description
Section titled “description”@description.setter@prevent_deleteddef description(description: str) -> NoneSet the description of the project.
readonly
Section titled “readonly”@property@prevent_deleteddef readonly() -> boolGet whether the project is read-only.
@property@prevent_deleteddef labels() -> List[str]Get the labels of the project.
script_only
Section titled “script_only”@property@prevent_deleteddef script_only() -> boolGet whether the project is script-only.
geometry_pipeline_version
Section titled “geometry_pipeline_version”@property@prevent_deleteddef geometry_pipeline_version() -> GeometryPipelineVersionGet the geometry pipeline version of the project.
get_geometry
Section titled “get_geometry”@prevent_deleteddef get_geometry() -> List[Geometry]Get geometry elements in the project. Currently only one geometry element per project is supported.
Returns:
A list of geometry elements in the project.
import_step
Section titled “import_step”@prevent_deleteddef import_step(filepath: str) -> GeometryImport the geometry file in the given path to the project.
Arguments:
filepath- path to a file in the local system
Returns:
The created geometry.
import_iges
Section titled “import_iges”@prevent_deleteddef import_iges(filepath: str) -> GeometryImport the geometry file in the given path to the project.
Arguments:
filepath- path to a file in the local system
Returns:
The created geometry.
import_brep
Section titled “import_brep”@prevent_deleteddef import_brep(filepath: str) -> GeometryImport the geometry file in the given path to the project.
Arguments:
filepath- path to a file in the local system
Returns:
The created geometry.
import_sat
Section titled “import_sat”@prevent_deleteddef import_sat(filepath: str) -> GeometryImport the geometry file in the given path to the project.
Arguments:
filepath- path to a file in the local system
Returns:
The created geometry.
import_msh
Section titled “import_msh”@prevent_deleteddef import_msh(filepath: str) -> GeometryImport the geometry file in the given path to the project.
Arguments:
filepath- path to a file in the local system
Returns:
The created geometry.
import_nas
Section titled “import_nas”@prevent_deleteddef import_nas(filepath: str) -> GeometryImport the geometry file in the given path to the project.
Arguments:
filepath- path to a file in the local system
Returns:
The created geometry.
import_gds2
Section titled “import_gds2”@prevent_deleteddef import_gds2(filepath: str, config: GDS2ImportConfig) -> GeometryImport the geometry file in the given path to the project.
Arguments:
filepath- path to a file in the local systemconfig- configuration for the GDS import.
Returns:
The created geometry.
add_shared_file
Section titled “add_shared_file”@prevent_deleteddef add_shared_file(filepath: str) -> rawapi.InputFileAdd the file in the given path to the project as shared file
Arguments:
filepath- path to a file in the local system. If used in a simulation, it is available with its basename.
Returns:
A handle to the created file.
add_shared_json_file
Section titled “add_shared_json_file”@prevent_deleteddef add_shared_json_file(name: str, content: dict) -> rawapi.InputFileAdd shared file to the project with the given dictionary serialized into JSON as content.
Arguments:
name- The name for the file during the simulationcontent- The content of the file
Returns:
A handle to the created file.
get_files
Section titled “get_files”@prevent_deleteddef get_files() -> List[rawapi.InputFile]Get all files in the project.
Returns:
A list of files in the project.
get_meshes
Section titled “get_meshes”@prevent_deleteddef get_meshes() -> List[Mesh]Get all meshes in the project.
Returns:
A list of meshes in the project.
create_mesh
Section titled “create_mesh”@prevent_deleteddef create_mesh(mesh_settings: MeshSettings) -> MeshCreate a new mesh in the project.
Arguments:
mesh_settings- The settings for the mesh.
Returns:
The created mesh.
get_simulation
Section titled “get_simulation”@prevent_deleteddef get_simulation(simulation_id: str) -> SimulationGet a simulation using the simulation ID.
Arguments:
simulation_id- The ID of the simulation to get.
Returns:
The simulation with the given ID.
get_simulations
Section titled “get_simulations”@prevent_deleteddef get_simulations() -> List[Simulation]Get all simulations in the project.
Returns:
A list of simulations in the project.
copy_simulation
Section titled “copy_simulation”@prevent_deleteddef copy_simulation(simulation_id: str) -> SimulationCreate a copy of a simulation in the project.
Arguments:
simulation_id- The ID of the simulation to copy.
Returns:
The copied simulation.
get_regions
Section titled “get_regions”@prevent_deleteddef get_regions() -> List[Region]Get all regions in the project.
Returns:
A list of regions in the project.
create_region_basic
Section titled “create_region_basic”@prevent_deleteddef create_region_basic(name: str, entity_type: rawapi.EntityType, entity_tags: List[int]) -> RegionCreate a basic region in the project.
Arguments:
name- The name of the region.entity_type- The type of the entity.entity_tags- The tags of the entity.
Returns:
The created region.
create_region_computed
Section titled “create_region_computed”@prevent_deleteddef create_region_computed(name: str, entity_type: rawapi.EntityType, operation: RegionOperation, source_region_ids: List[str]) -> ComputedRegionCreate a computed region in the project.
Arguments:
name- The name of the region.entity_type- The type of the entity.operation- The operation to perform on the source regions.source_region_ids- The IDs of the source regions.
Returns:
The created computed region.
create_region_rule
Section titled “create_region_rule”@prevent_deleteddef create_region_rule( name: str, entity_type: rawapi.EntityType, attribute_path: rawapi.AttributePath | None = None, bounding_box: rawapi.ExpressionBoundingBox | None = None, min_size: rawapi.ExpressionVector | None = None, max_size: rawapi.ExpressionVector | None = None) -> RegionCreate a region rule in the project.
Arguments:
name- The name of the region.entity_type- The type of the entity.attribute_path- The attribute path to use for the region.bounding_box- The bounding box to use for the region.min_size- The minimum size to use for the region.max_size- The maximum size to use for the region.
Returns:
The created region rule.
create_variable
Section titled “create_variable”@prevent_deleteddef create_variable(name: str, expression: str, description: str = "") -> SharedExpressionCreate an expression in the project.
create_function
Section titled “create_function”@prevent_deleteddef create_function(name: str, args: List[str], expression: str, description: str = "") -> SharedExpressionCreate a function in the project.
create_interpolated_function
Section titled “create_interpolated_function”@prevent_deleteddef create_interpolated_function(name: str, args: List[Tuple[str, List[float]]], values: List[float], description: str = "") -> SharedExpressionCreate an interpolated function in the project.
Arguments:
name- The name of the interpolated function.args- The arguments of the interpolated function.values- The values of the interpolated function.
Returns:
The created interpolated function.
create_variable_overrides
Section titled “create_variable_overrides”@prevent_deleteddef create_variable_overrides( name: str, overrides: List[Tuple[SharedExpression, str | float | int | List[str | float | int]]]) -> VariableOverridesCreate a VariableOverrides in the project. It can be used to override a value of a single or multiple variables, or to create a sweep over variables.
Arguments:
name- The name of the set of variable overrides.overrides- A list of variable overrides. The first element of the tuple is the variable to override and the second is the new value for the variable.
Returns:
The created variable overrides.
get_variable_overrides
Section titled “get_variable_overrides”@prevent_deleteddef get_variable_overrides() -> List[VariableOverrides]Get all variable overrides in the project.
get_materials
Section titled “get_materials”@prevent_deleteddef get_materials() -> List[Material]Get all materials in the project.
Returns:
A list of materials in the project.
@prevent_deleteddef save() -> NoneExplictly save the changes to the cloud made by
setting properties name and description.
@prevent_deleteddef delete() -> NoneDelete the project.
@prevent_deleteddef copy(with_results: bool = False, name: str | None = None, wait_for_completion: bool = True) -> SelfCopies the project and returns the copied project.
Arguments:
with_results- If True then files of the original project are copied to the new project.name- The name of the new project.wait_for_completion- If True, the copied project is returned after the copy job is completed. If False, get_copy_job() should be used to check the status of the copy job.
Returns:
The copied project.
get_copy_job
Section titled “get_copy_job”@prevent_deleteddef get_copy_job() -> Job | NoneGet the copy job for the project. The copy job exists only if the project was copied from another project with results.
Returns:
The copy job for the project.
allsolve.override
Section titled “allsolve.override”VariableOverrides Objects
Section titled “VariableOverrides Objects”class VariableOverrides()VariableOverrides is for managing variable overrides. It can be used to override a value of a single or multiple variables in a project, or to create a sweep over variables.
@classmethoddef create(cls, name: str, overrides: List[Tuple[SharedExpression, str | float | int | List[str | float | int]]], override_type: rawapi.SharedExpressionOverrideType = rawapi. SharedExpressionOverrideType.SWEEP, project_id: str | None = None) -> SelfCreate a new VariableOverrides.
Arguments:
name- The name of the set of variable overrides.overrides- A list of overrides of the VariableOverrides. The first element of the tuple is the variable to override and the second is the new value for the variable.override_type- The type of the VariableOverrides. Normal or Sweep.project_id- The ID of the project.
Returns:
The created VariableOverrides.
@classmethoddef get(cls, variable_overrides_id: str, project_id: str | None = None) -> SelfGet a VariableOverrides by its ID.
get_all
Section titled “get_all”@classmethoddef get_all(cls, project_id: str | None = None) -> List[Self]Get all VariableOverrides in a project.
@property@prevent_deleteddef id() -> strGet the ID of the VariableOverrides.
@property@prevent_deleteddef name() -> strGet the name of the VariableOverrides.
@name.setter@prevent_deleteddef name(name: str) -> NoneSet the name of the VariableOverrides.
@property@prevent_deleteddef type() -> rawapi.SharedExpressionOverrideTypeGet the type of the VariableOverrides.
overrides
Section titled “overrides”@property@prevent_deleteddef overrides() -> List[Tuple[SharedExpression, str]]Get the overrides of the VariableOverrides. The list is a copy of the overrides in the VariableOverrides. It the list is modified, use overrides setter to save the change. The list is a list of tuples, where the first element is the variable and the second is the new value for the variable.
overrides
Section titled “overrides”@overrides.setter@prevent_deleteddef overrides( overrides: List[Tuple[SharedExpression, str | float | int | List[str | float | int]]]) -> NoneSet the overrides of the VariableOverrides.
@prevent_deleteddef delete() -> NoneDelete the VariableOverrides.