exerpy 0.0.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. exerpy/__init__.py +12 -0
  2. exerpy/analyses.py +1711 -0
  3. exerpy/components/__init__.py +16 -0
  4. exerpy/components/combustion/__init__.py +0 -0
  5. exerpy/components/combustion/base.py +248 -0
  6. exerpy/components/component.py +126 -0
  7. exerpy/components/heat_exchanger/__init__.py +0 -0
  8. exerpy/components/heat_exchanger/base.py +449 -0
  9. exerpy/components/heat_exchanger/condenser.py +323 -0
  10. exerpy/components/heat_exchanger/simple.py +358 -0
  11. exerpy/components/heat_exchanger/steam_generator.py +264 -0
  12. exerpy/components/helpers/__init__.py +0 -0
  13. exerpy/components/helpers/cycle_closer.py +104 -0
  14. exerpy/components/nodes/__init__.py +0 -0
  15. exerpy/components/nodes/deaerator.py +318 -0
  16. exerpy/components/nodes/drum.py +164 -0
  17. exerpy/components/nodes/flash_tank.py +89 -0
  18. exerpy/components/nodes/mixer.py +332 -0
  19. exerpy/components/piping/__init__.py +0 -0
  20. exerpy/components/piping/valve.py +394 -0
  21. exerpy/components/power_machines/__init__.py +0 -0
  22. exerpy/components/power_machines/generator.py +168 -0
  23. exerpy/components/power_machines/motor.py +173 -0
  24. exerpy/components/turbomachinery/__init__.py +0 -0
  25. exerpy/components/turbomachinery/compressor.py +318 -0
  26. exerpy/components/turbomachinery/pump.py +310 -0
  27. exerpy/components/turbomachinery/turbine.py +351 -0
  28. exerpy/data/Ahrendts.json +90 -0
  29. exerpy/functions.py +637 -0
  30. exerpy/parser/__init__.py +0 -0
  31. exerpy/parser/from_aspen/__init__.py +0 -0
  32. exerpy/parser/from_aspen/aspen_config.py +61 -0
  33. exerpy/parser/from_aspen/aspen_parser.py +721 -0
  34. exerpy/parser/from_ebsilon/__init__.py +38 -0
  35. exerpy/parser/from_ebsilon/check_ebs_path.py +74 -0
  36. exerpy/parser/from_ebsilon/ebsilon_config.py +1055 -0
  37. exerpy/parser/from_ebsilon/ebsilon_functions.py +181 -0
  38. exerpy/parser/from_ebsilon/ebsilon_parser.py +660 -0
  39. exerpy/parser/from_ebsilon/utils.py +79 -0
  40. exerpy/parser/from_tespy/tespy_config.py +23 -0
  41. exerpy-0.0.1.dist-info/METADATA +158 -0
  42. exerpy-0.0.1.dist-info/RECORD +44 -0
  43. exerpy-0.0.1.dist-info/WHEEL +4 -0
  44. exerpy-0.0.1.dist-info/licenses/LICENSE +21 -0
@@ -0,0 +1,38 @@
1
+ import os
2
+ import sys
3
+ from typing import Optional
4
+
5
+ # Define the path to Ebsilon from environment variable
6
+ __ebsilon_path__ = os.getenv("EBS")
7
+
8
+ # Flag to indicate if Ebsilon is available
9
+ __ebsilon_available__ = False
10
+
11
+ if __ebsilon_path__ is not None:
12
+ # Add the Ebsilon path to the system path
13
+ sys.path.append(__ebsilon_path__)
14
+
15
+ try:
16
+ # Try to import EbsOpen
17
+ import EbsOpen
18
+
19
+ # Set the availability flag to True if import succeeds
20
+ __ebsilon_available__ = True
21
+ except ImportError:
22
+ # Give a clear error message with guidance
23
+ msg = (
24
+ "Could not find EbsOpen in the path specified by the 'EBS' "
25
+ "environment variable. Please ensure the path is correct and "
26
+ "points to a valid Ebsilon installation."
27
+ )
28
+ print(f"Warning: {msg}")
29
+
30
+
31
+ def is_ebsilon_available() -> bool:
32
+ """
33
+ Check if Ebsilon functionality is available.
34
+
35
+ Returns:
36
+ bool: True if Ebsilon is available, False otherwise.
37
+ """
38
+ return __ebsilon_available__
@@ -0,0 +1,74 @@
1
+ """
2
+ Utilities to check Ebsilon installation.
3
+
4
+ This module provides functions to check the Ebsilon installation
5
+ and validate the EBS environment variable.
6
+ """
7
+ import logging
8
+ import os
9
+ import sys
10
+ from typing import Optional
11
+ from typing import Tuple
12
+
13
+ from exerpy.parser.from_ebsilon import __ebsilon_available__
14
+ from exerpy.parser.from_ebsilon import __ebsilon_path__
15
+
16
+
17
+ def check_ebsilon_installation() -> Tuple[bool, Optional[str]]:
18
+ """
19
+ Check if Ebsilon is correctly installed and available.
20
+
21
+ Returns:
22
+ Tuple[bool, Optional[str]]: A tuple containing:
23
+ - A boolean indicating if Ebsilon is available
24
+ - A string with a message explaining the status (or None if available)
25
+ """
26
+ # Check if the EBS environment variable is set
27
+ if __ebsilon_path__ is None:
28
+ return False, "The EBS environment variable is not set."
29
+
30
+ # Check if the path exists
31
+ if not os.path.exists(__ebsilon_path__):
32
+ return False, f"The path specified by EBS environment variable does not exist: {__ebsilon_path__}"
33
+
34
+ # Check if EbsOpen can be imported
35
+ if not __ebsilon_available__:
36
+ return False, "EbsOpen module could not be imported. Please check your Ebsilon installation."
37
+
38
+ # All checks passed
39
+ return True, None
40
+
41
+
42
+ def validate_ebsilon_requirements() -> None:
43
+ """
44
+ Validate that all requirements for using Ebsilon functionality are met.
45
+
46
+ Prints status messages and usage instructions.
47
+
48
+ Raises:
49
+ RuntimeError: If running on a non-Windows platform.
50
+ """
51
+ # Check if running on Windows
52
+ if sys.platform != 'win32':
53
+ raise RuntimeError(
54
+ "Ebsilon functionality is only available on Windows platforms. "
55
+ f"Current platform: {sys.platform}"
56
+ )
57
+
58
+ # Check Ebsilon installation
59
+ is_available, message = check_ebsilon_installation()
60
+
61
+ if is_available:
62
+ print(f"✓ Ebsilon is properly installed and available at: {__ebsilon_path__}")
63
+ else:
64
+ print(f"✗ Ebsilon is not available: {message}")
65
+ print("\nTo enable Ebsilon functionality:")
66
+ print("1. Ensure Ebsilon Professional is installed on your system")
67
+ print("2. Set the EBS environment variable to the Ebsilon installation path")
68
+ print(" - Windows: setx EBS \"C:\\Path\\To\\Ebsilon\"")
69
+ print("3. Restart your Python environment or IDE")
70
+
71
+
72
+ if __name__ == "__main__":
73
+ # When run as a script, perform a full validation and output results
74
+ validate_ebsilon_requirements()