Skip to content

Attach a Python script to allow for preprocessing before running the analysis #4

@KwentiN-ui

Description

@KwentiN-ui

The RustPython project could be used to embed a Python interpreter with this software, allowing for easy preprocessing of INP files by calling a python program before running the analysis.

Ideas:

  • after selecting an analysis, the user can supply one or more Python files to be called in series
  • before invoking the CalculiX executable, these would be run by the built-in interpreter
  • the interpreter could be supplied with a string variable for the INP content, so the script would not need to deal with IO
  • the files would be stored inside the user directory, just like the configuration files
  • a run count could be supplied, so the analysis gets rerun automatically n times, allowing for easy parametrization

An example could look like this:

values = {
    0: "220000",
    1: "230000",
    2: "240000",
}

# this gets called by the application
def process(input_file:str, run:int) -> str:
    return input_file.replace("210000", values[run])

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions