Tools for accessing UNISIM variables from python
Project description
UNISIM connector
UNISIM connector is a tools developed by the SERG research group of the University of Florence for modifying UNISIM files from python.
The beta version can be downloaded using PIP:
pip install UNISIM_connector
Once the installation has been completed the user can import the tool and initialize the connector itself passing the path of the UNISIM file that has to be opened (in the example below the file is selected by the user trough a dialog box. If possible use a with statement for the initialization.
from UNISIMConnect import UNISIMConnector
from tkinter import filedialog
import tkinter as tk
root = tk.Tk()
root.withdraw()
unisim_path = filedialog.askopenfilename()
with UNISIMConnector(unisim_path) as unisim:
# insert your code here
Finally, you can ask the program to modify values in the spreadsheets inside the UNISIM file and wait until a solution has been reached
with UNISIMConnector(unisim_path) as unisim:
spreadsheet = unisim.get_spreadsheet("CALCULATION")
spreadsheet.set_cell_value("A5", 15)
unisim.wait_solution()
spreadsheet.get_cell_value("A6")
If you need to keep UNISIM open once the calculation has been completed you can set the option "close_on_completion=False".
with UNISIMConnector(unisim_path, close_on_completion=False) as unisim:
spreadsheet = unisim.get_spreadsheet("CALCULATION")
spreadsheet.set_cell_value("A5", 15)
unisim.wait_solution()
spreadsheet.get_cell_value("A6")
-------------------------- !!! THIS IS A BETA VERSION !!! --------------------------
please report any bug or problems in the installation to pietro.ungar@unifi.it
for further information visit: https://tinyurl.com/SERG-3ETool
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file UNISIM_connector-0.1.1.tar.gz
.
File metadata
- Download URL: UNISIM_connector-0.1.1.tar.gz
- Upload date:
- Size: 16.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a93c4b2f1be5e9eebd735ac643a7fffc4dd85a077d0eaef66ca6b9b2977dba9c |
|
MD5 | 86829afe8c8e488aa9b5eda03fce8e51 |
|
BLAKE2b-256 | eec2dd9d62c60dcc31f791deeb68eab46f9d9bd3db2b7b5c845ae6bb231f271d |