Skip to main content

A Python library for developing and executing Sesam workflows on local or cloud platforms, and for executing commands outside of workflow contexts.

Project description

SesamCommands: Streamlining Sesam Workflows and Local Command Execution

SesamCommands is a comprehensive Python package designed to simplify the development and execution of Sesam workflows on both local and cloud platforms. It provides a suite of executors that streamline the local execution of Sesam commands, allowing developers to invoke commands as if operating from a command-line interface, independent of any workflow context.

This package not only simplifies the development process but also adeptly handles the complexities of command execution involving Sesam Core, Wasim, and Sestra applications. The intricacies of workflow execution and management are taken care of by the OneWorkflow and OneCompute Python packages.

In summary, SesamCommands is an invaluable tool for developers seeking to enhance their productivity and streamline their Sesam workflow development process.

Usage and Examples

For a more comprehensive understanding and additional examples, please visit the Homepage link provided on this page.

"""Demonstration of executing a SesamCoreCommand as part of a larger workflow using the OneWorkflow client.
This workflow could contain many more commands."""

# Import necessary modules and functions
import asyncio
from dnv.oneworkflow.utils import (
    CommandInfo,
    one_workflow_client,
    run_managed_commands_in_parallel_async,
)
from dnv.sesam.commands import SesamCoreCommand

# Instantiate the OneWorkflow client with workspace ID and path
client = one_workflow_client(
    workspace_id="TestWorkflow", workspace_path=r"C:\MyWorkspace", cloud_run=False
)

# Create an instance of the SesamCoreCommand class, specifying the command, input file name, and options
sesam_core_command = SesamCoreCommand(
    command="uls", input_file_name="input.json", options="-v"
)

# Create an instance of the CommandInfo class, specifying the commands and load case folder name
cmd_info = CommandInfo(
    commands=[sesam_core_command],
    load_case_foldername="LoadCase1",
)

# Run workflow/command asynchronously
asyncio.run(
    run_managed_commands_in_parallel_async(
        client=client,
        commands_info=[cmd_info],
    )
)
"""
This script demonstrates how to execute a standalone SesamCoreCommand for FLS aggregation, independent of any workflow context,
similar to running an application from the command line.
"""

import os
from dnv.sesam.commands import SesamCoreCommand
from dnv.sesam.commands.executors import execute_command

working_directory = os.path.join(
    os.getcwd(), "data", "workspace_sesamcore_aggregation", "CommonFiles"
)

score_exe_cmd = SesamCoreCommand(
    working_dir=working_directory,
    command="accumulation accumulate",
    input_file_name="accumulation-input-ElementScreening.json",
    options=" ",
)

execute_command(score_exe_cmd)

License

MIT

Support

If you encounter any issues, have questions, or want to provide feedback, please get in touch with our support team at software.support@dnv.com. We are committed to continuously improving SesamCommands Python package and providing timely assistance to our users.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dnv_sesam_commands-5.23.1.0.tar.gz (4.0 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dnv_sesam_commands-5.23.1.0-py3-none-any.whl (4.1 MB view details)

Uploaded Python 3

File details

Details for the file dnv_sesam_commands-5.23.1.0.tar.gz.

File metadata

  • Download URL: dnv_sesam_commands-5.23.1.0.tar.gz
  • Upload date:
  • Size: 4.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.13

File hashes

Hashes for dnv_sesam_commands-5.23.1.0.tar.gz
Algorithm Hash digest
SHA256 386c438c16a8b8022ad4a14947aa5bc6323e567cadf13d556e9377bc29f7b6bd
MD5 d724b264b874c16ad94e7143d6e469cc
BLAKE2b-256 f3d8d6660bda5a250a770da2c34dd8329062e2b7a020ffccf996670f99215c05

See more details on using hashes here.

File details

Details for the file dnv_sesam_commands-5.23.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for dnv_sesam_commands-5.23.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f0b85fba23390ebd6be137144dbb48fc707bd1d3aeb1c950b5d89fedb637c8c5
MD5 da4d59ccf209bcda167205fe95fbf392
BLAKE2b-256 76d3fe0f77a871919dcd522aa37eb6b62a719c52f991ba410e64dd296d54c619

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page