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_directory=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.22.0.0.tar.gz (4.0 MB view details)

Uploaded Source

Built Distribution

dnv_sesam_commands-5.22.0.0-py3-none-any.whl (4.0 MB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for dnv_sesam_commands-5.22.0.0.tar.gz
Algorithm Hash digest
SHA256 73405a17df08abc99161979dfad5c02c921bbcbca7f6c46df51b6cec7e27aad5
MD5 43d633cf3e9a4f3aae4a03e8721a149b
BLAKE2b-256 02af4a2621d96210a1878a0d59acbb2d09829da75eff57858500a4ff237fcde6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dnv_sesam_commands-5.22.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cdb5820a57c430ce555051fa68f0520ef0e7cbd0975c2c0d63eed588c646142f
MD5 75dea4eecd2525bdfcee9004c74ba37d
BLAKE2b-256 e200a2a05c28e2e41ac47f24c0e7a343fd2354d538fc67410984a46193374355

See more details on using hashes here.

Supported by

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