-
Notifications
You must be signed in to change notification settings - Fork 1
🚀Running SFPPy
SFFPy
can be run without any specific installation (e.g., in Spyder):
- from the 📂
SFPPy/
- from anywhere if the 📂
SFPPy/
is in Pythonsys.path
The 📂
SFPPy/
is folder containing the folder 📁patankar/
and 📄example1.py
,📄example2.py
…📂
SFPPy/
is the folder is created when you unzip the last downloaded release (download page). Depending on the version, this folder is namedSFPPy_v1.30/
orSFPPy_v1.30min/
.
In any Python 📄 script which is not located in 📂SFPPy/
, add at the beginning;
# %% Temporarily sys.path modification
import sys
# Check if SFPPy path is already in sys.path
SFPPy_path = '/replace/it/by/your/path/SFPPy_v1.30' # <---- update it
if SFPPy_path in sys.path:
print(f"SFPPy installation '{SFPPy_path}' is already in sys.path.")
else:
print(f"Add SFPPy path '{SFPPy_path}' to sys.path.")
sys.path.append(SFPPy_path)
Add SFPPy path '/replace/it/by/your/path/SFPPy_v1.30'to sys.path.
You script can continue afterwards as usual:
# %% Place your code below
from patankar.loadpubchem import migrant
list_of_migrants = ["toluene","limonene","BHT","Irganox 1076"]
m = [migrant(s) for s in list_of_migrants]
print(m)
⚠️ All imports ofSFPPy
modules must includepatankar
.❌ Do not add 📁
patankar/
tosys.path
since the same import rules are used internally. 📁patankar/
is the core library ofSFPPy
but not the application itself, which include examples, its documentation…
patankar.migration |
🏗️: Core solver implementing the Patankar finite-volume method for mass transfer modeling. |
patankar.geometry |
📐: Defines and processes 3D packaging geometries, including surface-area-to-volume calculations Use from patankar.geometry import help_geometry and help_geometry() to list all predefined geometries.
|
patankar.food |
🍎: Models food layers and their interactions with packaging materials. 💡Use from patankar.food import help_food and help_food() to list all predefined food, simulants and contact conditions.
|
patankar.layer |
📜: Manages materials and multilayer packaging structures. 💡 Use from patankar.layer import help_layer and help_layer() to list all predefined polymers and materials.
|
patankar.property |
📊: Computes essential physical and chemical properties (e.g., diffusivities, partitioning coefficients). |
patankar.loadpubchem |
🔬: Interfaces with PubChem to retrieve molecular properties and cache them locally. |
patankar.private.somemodule |
🔒Contains internal modules and utilities not intended for direct usage by end-users. For example: patankar.private.pubchempy
|
Each module contains many classes and subclasses. Import only needed classes (do not use
from.patankar.module import *
orimport patankar.module
). The methods are documented and attached to objects.Use helpers:
help_geometry()
,help_food()
,help_layer()
to access