PyThermoLinkDB 1.3.2__tar.gz → 1.3.3__tar.gz

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 (27) hide show
  1. {pythermolinkdb-1.3.2 → pythermolinkdb-1.3.3}/LICENSE +1 -1
  2. pythermolinkdb-1.3.3/MANIFEST.in +1 -0
  3. pythermolinkdb-1.3.3/PKG-INFO +278 -0
  4. pythermolinkdb-1.3.3/PyThermoLinkDB.egg-info/PKG-INFO +278 -0
  5. {pythermolinkdb-1.3.2 → pythermolinkdb-1.3.3}/PyThermoLinkDB.egg-info/SOURCES.txt +2 -8
  6. pythermolinkdb-1.3.3/pyproject.toml +43 -0
  7. {pythermolinkdb-1.3.2 → pythermolinkdb-1.3.3}/test/test-3.py +77 -2
  8. pythermolinkdb-1.3.2/PKG-INFO +0 -292
  9. pythermolinkdb-1.3.2/PyThermoLinkDB.egg-info/PKG-INFO +0 -292
  10. pythermolinkdb-1.3.2/pyThermoLinkDB/config/__init__.py +0 -3
  11. pythermolinkdb-1.3.2/pyThermoLinkDB/config/settings.py +0 -8
  12. pythermolinkdb-1.3.2/pyThermoLinkDB/data/__init__.py +0 -0
  13. pythermolinkdb-1.3.2/pyThermoLinkDB/docs/__init__.py +0 -4
  14. pythermolinkdb-1.3.2/pyThermoLinkDB/docs/thermodbhub.py +0 -649
  15. pythermolinkdb-1.3.2/pyThermoLinkDB/docs/thermolink.py +0 -179
  16. pythermolinkdb-1.3.2/pyThermoLinkDB/docs/utils.py +0 -339
  17. pythermolinkdb-1.3.2/setup.py +0 -53
  18. {pythermolinkdb-1.3.2 → pythermolinkdb-1.3.3}/PyThermoLinkDB.egg-info/dependency_links.txt +0 -0
  19. {pythermolinkdb-1.3.2 → pythermolinkdb-1.3.3}/PyThermoLinkDB.egg-info/requires.txt +0 -0
  20. {pythermolinkdb-1.3.2 → pythermolinkdb-1.3.3}/PyThermoLinkDB.egg-info/top_level.txt +0 -0
  21. {pythermolinkdb-1.3.2 → pythermolinkdb-1.3.3}/README.md +0 -0
  22. {pythermolinkdb-1.3.2 → pythermolinkdb-1.3.3}/pyThermoLinkDB/__init__.py +0 -0
  23. {pythermolinkdb-1.3.2 → pythermolinkdb-1.3.3}/pyThermoLinkDB/app.py +0 -0
  24. {pythermolinkdb-1.3.2 → pythermolinkdb-1.3.3}/setup.cfg +0 -0
  25. {pythermolinkdb-1.3.2 → pythermolinkdb-1.3.3}/test/test-1.py +0 -0
  26. {pythermolinkdb-1.3.2 → pythermolinkdb-1.3.3}/test/test-2.py +0 -0
  27. {pythermolinkdb-1.3.2 → pythermolinkdb-1.3.3}/test/test-4.py +0 -0
@@ -1,4 +1,4 @@
1
- MIT License
1
+ # MIT License
2
2
 
3
3
  Copyright (c) 2025 Sina Gilassi
4
4
 
@@ -0,0 +1 @@
1
+ include LICENSE
@@ -0,0 +1,278 @@
1
+ Metadata-Version: 2.4
2
+ Name: PyThermoLinkDB
3
+ Version: 1.3.3
4
+ Summary: PyThermoLinkDB is a Python package providing a robust and efficient interface between `PyThermoDB` and other applications.
5
+ Author-email: Sina Gilassi <sina.gilassi@gmail.com>
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/sinagilassi/PyThermoLinkDB
8
+ Project-URL: Documentation, https://pythermolinkdb.readthedocs.io/en/latest/
9
+ Project-URL: Source, https://github.com/sinagilassi/PyThermoLinkDB
10
+ Project-URL: Issue Tracker, https://github.com/sinagilassi/PyThermoLinkDB/issues
11
+ Keywords: chemical engineering,thermodynamics,PyThermoDB
12
+ Classifier: Development Status :: 1 - Planning
13
+ Classifier: Intended Audience :: Education
14
+ Classifier: Programming Language :: Python :: 3.10
15
+ Classifier: Operating System :: Unix
16
+ Classifier: Operating System :: MacOS :: MacOS X
17
+ Classifier: Operating System :: Microsoft :: Windows
18
+ Requires-Python: >=3.10
19
+ Description-Content-Type: text/markdown
20
+ License-File: LICENSE
21
+ Requires-Dist: PyYAML
22
+ Requires-Dist: PyThermoDB
23
+ Dynamic: license-file
24
+
25
+ # PyThermoLinkDB
26
+
27
+ ![PyThermoLinkDB](https://drive.google.com/uc?export=view&id=1uwEMQLNJv7vIJ1Frq2cDORyhrqSwNRVS)
28
+
29
+ ![Downloads](https://img.shields.io/pypi/dm/PyThermoLinkDB) ![PyPI](https://img.shields.io/pypi/v/PyThermoLinkDB) ![Python Version](https://img.shields.io/pypi/pyversions/PyThermoLinkDB.svg) ![License](https://img.shields.io/pypi/l/PyThermoLinkDB)
30
+
31
+ `PyThermoLinkDB` is a Python package providing a robust and efficient interface between `PyThermoDB` and other applications. It enables seamless thermodynamic data exchange, integration, and analysis. With PyThermoLinkDB, developers can easily link PyThermoDB to various tools, frameworks, and databases, streamlining thermodynamic workflows.
32
+
33
+ ## ✨ **Key Features**
34
+
35
+ - 🔹 Simple and intuitive API
36
+ - ⚡ Efficient data transfer and integration
37
+ - 📂 Compatible with multiple data formats
38
+ - 📚 Extensive documentation and examples
39
+
40
+ Ideal for researchers, engineers, and developers working with thermodynamic data, PyThermoLinkDB simplifies data integration and analysis, accelerating scientific discoveries and industrial applications.
41
+
42
+
43
+ ## 🌐 **Google Colab**
44
+
45
+ You can run `PyThermoLinkDB` in Google Colab:
46
+
47
+ - Basic Usage 1 [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1JU1ljkHgKcBNe_CuSh2Bg7hoKwQUJti0?usp=sharing)
48
+
49
+
50
+ ## 📥 **Installation**
51
+
52
+ Install `pyThermoLinkDB` and `PyThermoDB` with pip
53
+
54
+ ```python
55
+ pip install pyThermoLinkDB
56
+ pip install PyThermoDB
57
+ ```
58
+
59
+ ## 🛠️ **Usage Example**
60
+
61
+ ### 🔄 **Load ThermoDB**
62
+
63
+ This section demonstrates how to load thermodynamic data files from `PyThermoDB`.
64
+
65
+ Multiple thermodynamic databases are imported: one for CO2, one for methanol, and one for NRTL interaction parameters. Each database is loaded from a pickle file using the `load_thermodb` function, and then verified with the `check()` method to ensure data integrity.
66
+
67
+ ```python
68
+ # import packages/modules
69
+ import os
70
+ from rich import print
71
+ import pyThermoLinkDB as ptdblink
72
+ import pyThermoDB as ptdb
73
+
74
+ # SECTION CO2
75
+ CO2_thermodb_file = os.path.join(
76
+ os.getcwd(), 'test', 'carbon dioxide-1.pkl')
77
+ # load
78
+ CO2_thermodb = ptdb.load_thermodb(CO2_thermodb_file)
79
+ print(type(CO2_thermodb))
80
+
81
+ # check
82
+ print(CO2_thermodb.check())
83
+
84
+ # SECTION methanol
85
+ # thermodb file name
86
+ MeOH_thermodb_file = os.path.join(os.getcwd(), 'test', 'methanol-1.pkl')
87
+ print(f"thermodb file: {MeOH_thermodb_file}")
88
+ # load
89
+ MeOH_thermodb = ptdb.load_thermodb(MeOH_thermodb_file)
90
+ print(type(MeOH_thermodb))
91
+
92
+ MeOH_thermodb
93
+
94
+ # check
95
+ print(MeOH_thermodb.check())
96
+
97
+ # SECTION nrtl
98
+ # thermodb file name
99
+ nrtl_thermodb_file = os.path.join(
100
+ os.getcwd(), 'test', 'thermodb_nrtl_1.pkl')
101
+ print(f"thermodb file: {nrtl_thermodb_file}")
102
+ # load
103
+ nrtl_thermodb = ptdb.load_thermodb(nrtl_thermodb_file)
104
+ print(type(nrtl_thermodb))
105
+
106
+ # check
107
+ print(nrtl_thermodb.check())
108
+ ```
109
+
110
+ ### 🔌 **Initialize Thermodb Hub**
111
+
112
+ This section demonstrates how to initialize a ThermoDB hub using the `init()` function, which creates a central repository for thermodynamic data.
113
+
114
+ The code shows adding different component databases (methanol, CO2) as well as interaction parameter data (NRTL) to the hub. The `items()` method is used to list all components currently stored in the hub.
115
+
116
+ ```python
117
+ # init thermodb hub
118
+ thub1 = ptdblink.init()
119
+ print(type(thub1))
120
+
121
+ # add component thermodb
122
+ thub1.add_thermodb('MeOH', MeOH_thermodb)
123
+ thub1.add_thermodb('CO2', CO2_thermodb)
124
+ # matrix data
125
+ thub1.add_thermodb('NRTL', nrtl_thermodb)
126
+
127
+ # get components
128
+ print(thub1.items())
129
+ ```
130
+
131
+ ### ⚙️ **ThermoDB Link Configuration**
132
+
133
+ This section shows the format of the YAML configuration file used to define thermodynamic properties and equations for different compounds. Each component has a `DATA` section for properties (like critical pressure, temperature) and an `EQUATIONS` section for thermodynamic relationships. The configuration file structure helps maintain consistent property mapping across the database.
134
+
135
+ You can use markdown (`.md`), YAML (`.yml`), or text (`.txt`) files to set the ThermoDB configuration. It is also possible to define a variable directly in your code and add the content of a `.yml`, `.txt`, or `.md` file as a string, as long as the format is correct and parsable.
136
+
137
+ Thermodb rule format (`thermodb_config.yml`):
138
+
139
+ ```yml
140
+ CO2:
141
+ DATA:
142
+ Pc: Pc
143
+ Tc: Tc
144
+ AcFa: AcFa
145
+ EQUATIONS:
146
+ vapor-pressure: VaPr
147
+ heat-capacity: Cp_IG
148
+ acetylene:
149
+ DATA:
150
+ Pc: Pc
151
+ Tc: Tc
152
+ AcFa: AcFa
153
+ EQUATIONS:
154
+ vapor-pressure: VaPr
155
+ ```
156
+
157
+ ```markdown
158
+ ## CO2
159
+
160
+ - DATA:
161
+ Pc: Pc
162
+ Tc: Tc
163
+ AcFa: AcFa
164
+ - EQUATIONS:
165
+ vapor-pressure: VaPr
166
+ heat-capacity: Cp_IG
167
+ ```
168
+
169
+ ```txt
170
+ # CO2
171
+ - DATA:
172
+ Pc: Pc
173
+ Tc: Tc
174
+ AcFa: AcFa
175
+ - EQUATIONS:
176
+ vapor-pressure: VaPr
177
+ heat-capacity: Cp_IG
178
+ ```
179
+
180
+ ```python
181
+ # add thermodb rule
182
+ thermodb_config_file = os.path.join(os.getcwd(), 'test', 'thermodb_config.yml')
183
+
184
+ # all components
185
+ res_ = thub1.config_thermodb_rule(thermodb_config_file)
186
+ # selected components
187
+ #res_ = thub1.config_thermodb_rule(thermodb_config_file, names=["MeOH", "CO2"])
188
+ print(res_)
189
+ ```
190
+
191
+ ### 🔧 **Add/Update ThermoDB Rule**
192
+
193
+ This section demonstrates how to add or update a ThermoDB rule for a specific chemical compound (e.g., CO2). The rule includes critical data properties and equations related to the compound, which are then added to the ThermoDB using the `add_thermodb_rule` method.
194
+
195
+ ```python
196
+ # update thermodb rule
197
+ thermodb_rule_CO2 = {
198
+ 'DATA': {
199
+ 'Pc': 'Pc1',
200
+ 'Tc': 'Tc1',
201
+ 'AcFa': 'AcFa1'
202
+ },
203
+ 'EQUATIONS': {
204
+ 'vapor-pressure': 'VaPr1',
205
+ 'heat-capacity': 'Cp_IG1'
206
+ }
207
+ }
208
+
209
+ # add thermodb rule for CO2
210
+ thub1.add_thermodb_rule('CO2', thermodb_rule_CO2)
211
+ ```
212
+
213
+ ### 🗑️ **Delete ThermoDB Rule**
214
+
215
+ This section demonstrates how to delete a specific ThermoDB rule using the `delete_thermodb_rule` method. In this example, the rule associated with 'CO2' is being removed.
216
+
217
+ ```python
218
+ # delete thermodb rule for CO2
219
+ thub1.delete_thermodb_rule('CO2')
220
+ ```
221
+
222
+ ### 🔨 **Build ThermoDB Hub**
223
+
224
+ This section demonstrates the process of building data sources and equation sources using the `build` method, and then prints the resulting objects. Additionally, it showcases accessing and printing the `hub` attribute.
225
+
226
+ ```python
227
+ # build
228
+ datasource, equationsource = thub1.build()
229
+ print(datasource)
230
+ print(equationsource)
231
+
232
+ # hub
233
+ print(thub1.hub)
234
+ ```
235
+
236
+ ### 📊 **Retrieve Data/Equation**
237
+
238
+ This section demonstrates how to access various thermodynamic data and equations from the built ThermoDB hub. Examples include retrieving critical properties (Pc, Tc) for different components, NRTL interaction parameters, and calculating values using vapor pressure and activity coefficient equations at specified conditions.
239
+
240
+ ```python
241
+ # CO2 data
242
+ dt1_ = datasource['CO2']['Pc']
243
+ print(type(dt1_))
244
+ print(dt1_)
245
+
246
+ # MeOH data
247
+ dt2_ = datasource['MeOH']['Tc']
248
+ print(type(dt2_))
249
+ print(dt2_)
250
+
251
+ # NRTL data
252
+ dt3_ = datasource['NRTL']['alpha_i_j']
253
+ print(type(dt3_))
254
+ print(dt3_.ij("Alpha_methanol_ethanol"))
255
+
256
+ # CO2 equation
257
+ eq1_ = equationsource['CO2']['VaPr']
258
+ print(type(eq1_))
259
+ print(eq1_)
260
+ print(eq1_.args)
261
+ print(eq1_.cal(T=298.15))
262
+
263
+ # nrtl equation
264
+ eq2_ = equationsource['NRTL']['tau_i_j']
265
+ print(type(eq2_))
266
+ print(eq2_)
267
+ print(eq2_.args)
268
+ print(eq2_.cal(T=298.15))
269
+ ```
270
+
271
+ ## ❓ **FAQ**
272
+
273
+ For any question, contact me on [LinkedIn](https://www.linkedin.com/in/sina-gilassi/)
274
+
275
+
276
+ ## 👨‍💻 **Authors**
277
+
278
+ - [@sinagilassi](https://www.github.com/sinagilassi)
@@ -0,0 +1,278 @@
1
+ Metadata-Version: 2.4
2
+ Name: PyThermoLinkDB
3
+ Version: 1.3.3
4
+ Summary: PyThermoLinkDB is a Python package providing a robust and efficient interface between `PyThermoDB` and other applications.
5
+ Author-email: Sina Gilassi <sina.gilassi@gmail.com>
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/sinagilassi/PyThermoLinkDB
8
+ Project-URL: Documentation, https://pythermolinkdb.readthedocs.io/en/latest/
9
+ Project-URL: Source, https://github.com/sinagilassi/PyThermoLinkDB
10
+ Project-URL: Issue Tracker, https://github.com/sinagilassi/PyThermoLinkDB/issues
11
+ Keywords: chemical engineering,thermodynamics,PyThermoDB
12
+ Classifier: Development Status :: 1 - Planning
13
+ Classifier: Intended Audience :: Education
14
+ Classifier: Programming Language :: Python :: 3.10
15
+ Classifier: Operating System :: Unix
16
+ Classifier: Operating System :: MacOS :: MacOS X
17
+ Classifier: Operating System :: Microsoft :: Windows
18
+ Requires-Python: >=3.10
19
+ Description-Content-Type: text/markdown
20
+ License-File: LICENSE
21
+ Requires-Dist: PyYAML
22
+ Requires-Dist: PyThermoDB
23
+ Dynamic: license-file
24
+
25
+ # PyThermoLinkDB
26
+
27
+ ![PyThermoLinkDB](https://drive.google.com/uc?export=view&id=1uwEMQLNJv7vIJ1Frq2cDORyhrqSwNRVS)
28
+
29
+ ![Downloads](https://img.shields.io/pypi/dm/PyThermoLinkDB) ![PyPI](https://img.shields.io/pypi/v/PyThermoLinkDB) ![Python Version](https://img.shields.io/pypi/pyversions/PyThermoLinkDB.svg) ![License](https://img.shields.io/pypi/l/PyThermoLinkDB)
30
+
31
+ `PyThermoLinkDB` is a Python package providing a robust and efficient interface between `PyThermoDB` and other applications. It enables seamless thermodynamic data exchange, integration, and analysis. With PyThermoLinkDB, developers can easily link PyThermoDB to various tools, frameworks, and databases, streamlining thermodynamic workflows.
32
+
33
+ ## ✨ **Key Features**
34
+
35
+ - 🔹 Simple and intuitive API
36
+ - ⚡ Efficient data transfer and integration
37
+ - 📂 Compatible with multiple data formats
38
+ - 📚 Extensive documentation and examples
39
+
40
+ Ideal for researchers, engineers, and developers working with thermodynamic data, PyThermoLinkDB simplifies data integration and analysis, accelerating scientific discoveries and industrial applications.
41
+
42
+
43
+ ## 🌐 **Google Colab**
44
+
45
+ You can run `PyThermoLinkDB` in Google Colab:
46
+
47
+ - Basic Usage 1 [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1JU1ljkHgKcBNe_CuSh2Bg7hoKwQUJti0?usp=sharing)
48
+
49
+
50
+ ## 📥 **Installation**
51
+
52
+ Install `pyThermoLinkDB` and `PyThermoDB` with pip
53
+
54
+ ```python
55
+ pip install pyThermoLinkDB
56
+ pip install PyThermoDB
57
+ ```
58
+
59
+ ## 🛠️ **Usage Example**
60
+
61
+ ### 🔄 **Load ThermoDB**
62
+
63
+ This section demonstrates how to load thermodynamic data files from `PyThermoDB`.
64
+
65
+ Multiple thermodynamic databases are imported: one for CO2, one for methanol, and one for NRTL interaction parameters. Each database is loaded from a pickle file using the `load_thermodb` function, and then verified with the `check()` method to ensure data integrity.
66
+
67
+ ```python
68
+ # import packages/modules
69
+ import os
70
+ from rich import print
71
+ import pyThermoLinkDB as ptdblink
72
+ import pyThermoDB as ptdb
73
+
74
+ # SECTION CO2
75
+ CO2_thermodb_file = os.path.join(
76
+ os.getcwd(), 'test', 'carbon dioxide-1.pkl')
77
+ # load
78
+ CO2_thermodb = ptdb.load_thermodb(CO2_thermodb_file)
79
+ print(type(CO2_thermodb))
80
+
81
+ # check
82
+ print(CO2_thermodb.check())
83
+
84
+ # SECTION methanol
85
+ # thermodb file name
86
+ MeOH_thermodb_file = os.path.join(os.getcwd(), 'test', 'methanol-1.pkl')
87
+ print(f"thermodb file: {MeOH_thermodb_file}")
88
+ # load
89
+ MeOH_thermodb = ptdb.load_thermodb(MeOH_thermodb_file)
90
+ print(type(MeOH_thermodb))
91
+
92
+ MeOH_thermodb
93
+
94
+ # check
95
+ print(MeOH_thermodb.check())
96
+
97
+ # SECTION nrtl
98
+ # thermodb file name
99
+ nrtl_thermodb_file = os.path.join(
100
+ os.getcwd(), 'test', 'thermodb_nrtl_1.pkl')
101
+ print(f"thermodb file: {nrtl_thermodb_file}")
102
+ # load
103
+ nrtl_thermodb = ptdb.load_thermodb(nrtl_thermodb_file)
104
+ print(type(nrtl_thermodb))
105
+
106
+ # check
107
+ print(nrtl_thermodb.check())
108
+ ```
109
+
110
+ ### 🔌 **Initialize Thermodb Hub**
111
+
112
+ This section demonstrates how to initialize a ThermoDB hub using the `init()` function, which creates a central repository for thermodynamic data.
113
+
114
+ The code shows adding different component databases (methanol, CO2) as well as interaction parameter data (NRTL) to the hub. The `items()` method is used to list all components currently stored in the hub.
115
+
116
+ ```python
117
+ # init thermodb hub
118
+ thub1 = ptdblink.init()
119
+ print(type(thub1))
120
+
121
+ # add component thermodb
122
+ thub1.add_thermodb('MeOH', MeOH_thermodb)
123
+ thub1.add_thermodb('CO2', CO2_thermodb)
124
+ # matrix data
125
+ thub1.add_thermodb('NRTL', nrtl_thermodb)
126
+
127
+ # get components
128
+ print(thub1.items())
129
+ ```
130
+
131
+ ### ⚙️ **ThermoDB Link Configuration**
132
+
133
+ This section shows the format of the YAML configuration file used to define thermodynamic properties and equations for different compounds. Each component has a `DATA` section for properties (like critical pressure, temperature) and an `EQUATIONS` section for thermodynamic relationships. The configuration file structure helps maintain consistent property mapping across the database.
134
+
135
+ You can use markdown (`.md`), YAML (`.yml`), or text (`.txt`) files to set the ThermoDB configuration. It is also possible to define a variable directly in your code and add the content of a `.yml`, `.txt`, or `.md` file as a string, as long as the format is correct and parsable.
136
+
137
+ Thermodb rule format (`thermodb_config.yml`):
138
+
139
+ ```yml
140
+ CO2:
141
+ DATA:
142
+ Pc: Pc
143
+ Tc: Tc
144
+ AcFa: AcFa
145
+ EQUATIONS:
146
+ vapor-pressure: VaPr
147
+ heat-capacity: Cp_IG
148
+ acetylene:
149
+ DATA:
150
+ Pc: Pc
151
+ Tc: Tc
152
+ AcFa: AcFa
153
+ EQUATIONS:
154
+ vapor-pressure: VaPr
155
+ ```
156
+
157
+ ```markdown
158
+ ## CO2
159
+
160
+ - DATA:
161
+ Pc: Pc
162
+ Tc: Tc
163
+ AcFa: AcFa
164
+ - EQUATIONS:
165
+ vapor-pressure: VaPr
166
+ heat-capacity: Cp_IG
167
+ ```
168
+
169
+ ```txt
170
+ # CO2
171
+ - DATA:
172
+ Pc: Pc
173
+ Tc: Tc
174
+ AcFa: AcFa
175
+ - EQUATIONS:
176
+ vapor-pressure: VaPr
177
+ heat-capacity: Cp_IG
178
+ ```
179
+
180
+ ```python
181
+ # add thermodb rule
182
+ thermodb_config_file = os.path.join(os.getcwd(), 'test', 'thermodb_config.yml')
183
+
184
+ # all components
185
+ res_ = thub1.config_thermodb_rule(thermodb_config_file)
186
+ # selected components
187
+ #res_ = thub1.config_thermodb_rule(thermodb_config_file, names=["MeOH", "CO2"])
188
+ print(res_)
189
+ ```
190
+
191
+ ### 🔧 **Add/Update ThermoDB Rule**
192
+
193
+ This section demonstrates how to add or update a ThermoDB rule for a specific chemical compound (e.g., CO2). The rule includes critical data properties and equations related to the compound, which are then added to the ThermoDB using the `add_thermodb_rule` method.
194
+
195
+ ```python
196
+ # update thermodb rule
197
+ thermodb_rule_CO2 = {
198
+ 'DATA': {
199
+ 'Pc': 'Pc1',
200
+ 'Tc': 'Tc1',
201
+ 'AcFa': 'AcFa1'
202
+ },
203
+ 'EQUATIONS': {
204
+ 'vapor-pressure': 'VaPr1',
205
+ 'heat-capacity': 'Cp_IG1'
206
+ }
207
+ }
208
+
209
+ # add thermodb rule for CO2
210
+ thub1.add_thermodb_rule('CO2', thermodb_rule_CO2)
211
+ ```
212
+
213
+ ### 🗑️ **Delete ThermoDB Rule**
214
+
215
+ This section demonstrates how to delete a specific ThermoDB rule using the `delete_thermodb_rule` method. In this example, the rule associated with 'CO2' is being removed.
216
+
217
+ ```python
218
+ # delete thermodb rule for CO2
219
+ thub1.delete_thermodb_rule('CO2')
220
+ ```
221
+
222
+ ### 🔨 **Build ThermoDB Hub**
223
+
224
+ This section demonstrates the process of building data sources and equation sources using the `build` method, and then prints the resulting objects. Additionally, it showcases accessing and printing the `hub` attribute.
225
+
226
+ ```python
227
+ # build
228
+ datasource, equationsource = thub1.build()
229
+ print(datasource)
230
+ print(equationsource)
231
+
232
+ # hub
233
+ print(thub1.hub)
234
+ ```
235
+
236
+ ### 📊 **Retrieve Data/Equation**
237
+
238
+ This section demonstrates how to access various thermodynamic data and equations from the built ThermoDB hub. Examples include retrieving critical properties (Pc, Tc) for different components, NRTL interaction parameters, and calculating values using vapor pressure and activity coefficient equations at specified conditions.
239
+
240
+ ```python
241
+ # CO2 data
242
+ dt1_ = datasource['CO2']['Pc']
243
+ print(type(dt1_))
244
+ print(dt1_)
245
+
246
+ # MeOH data
247
+ dt2_ = datasource['MeOH']['Tc']
248
+ print(type(dt2_))
249
+ print(dt2_)
250
+
251
+ # NRTL data
252
+ dt3_ = datasource['NRTL']['alpha_i_j']
253
+ print(type(dt3_))
254
+ print(dt3_.ij("Alpha_methanol_ethanol"))
255
+
256
+ # CO2 equation
257
+ eq1_ = equationsource['CO2']['VaPr']
258
+ print(type(eq1_))
259
+ print(eq1_)
260
+ print(eq1_.args)
261
+ print(eq1_.cal(T=298.15))
262
+
263
+ # nrtl equation
264
+ eq2_ = equationsource['NRTL']['tau_i_j']
265
+ print(type(eq2_))
266
+ print(eq2_)
267
+ print(eq2_.args)
268
+ print(eq2_.cal(T=298.15))
269
+ ```
270
+
271
+ ## ❓ **FAQ**
272
+
273
+ For any question, contact me on [LinkedIn](https://www.linkedin.com/in/sina-gilassi/)
274
+
275
+
276
+ ## 👨‍💻 **Authors**
277
+
278
+ - [@sinagilassi](https://www.github.com/sinagilassi)
@@ -1,6 +1,7 @@
1
1
  LICENSE
2
+ MANIFEST.in
2
3
  README.md
3
- setup.py
4
+ pyproject.toml
4
5
  PyThermoLinkDB.egg-info/PKG-INFO
5
6
  PyThermoLinkDB.egg-info/SOURCES.txt
6
7
  PyThermoLinkDB.egg-info/dependency_links.txt
@@ -8,13 +9,6 @@ PyThermoLinkDB.egg-info/requires.txt
8
9
  PyThermoLinkDB.egg-info/top_level.txt
9
10
  pyThermoLinkDB/__init__.py
10
11
  pyThermoLinkDB/app.py
11
- pyThermoLinkDB/config/__init__.py
12
- pyThermoLinkDB/config/settings.py
13
- pyThermoLinkDB/data/__init__.py
14
- pyThermoLinkDB/docs/__init__.py
15
- pyThermoLinkDB/docs/thermodbhub.py
16
- pyThermoLinkDB/docs/thermolink.py
17
- pyThermoLinkDB/docs/utils.py
18
12
  test/test-1.py
19
13
  test/test-2.py
20
14
  test/test-3.py
@@ -0,0 +1,43 @@
1
+ [build-system]
2
+ requires = ["setuptools>=42", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "PyThermoLinkDB"
7
+ version = "1.3.3"
8
+ description = "PyThermoLinkDB is a Python package providing a robust and efficient interface between `PyThermoDB` and other applications."
9
+ readme = "README.md"
10
+ authors = [
11
+ {name = "Sina Gilassi", email = "sina.gilassi@gmail.com"}
12
+ ]
13
+ license = "MIT"
14
+ requires-python = ">=3.10"
15
+ classifiers = [
16
+ "Development Status :: 1 - Planning",
17
+ "Intended Audience :: Education",
18
+ "Programming Language :: Python :: 3.10",
19
+ "Operating System :: Unix",
20
+ "Operating System :: MacOS :: MacOS X",
21
+ "Operating System :: Microsoft :: Windows",
22
+ ]
23
+ keywords = ["chemical engineering", "thermodynamics", "PyThermoDB"]
24
+ dependencies = [
25
+ "PyYAML",
26
+ "PyThermoDB"
27
+ ]
28
+
29
+ [project.urls]
30
+ Homepage = "https://github.com/sinagilassi/PyThermoLinkDB"
31
+ Documentation = "https://pythermolinkdb.readthedocs.io/en/latest/"
32
+ Source = "https://github.com/sinagilassi/PyThermoLinkDB"
33
+ "Issue Tracker" = "https://github.com/sinagilassi/PyThermoLinkDB/issues"
34
+
35
+ [tool.setuptools]
36
+ packages = ["pyThermoLinkDB"]
37
+ include-package-data = true
38
+
39
+ [tool.setuptools.package-data]
40
+ "*" = ["config/*.yml", "data/*.csv"]
41
+
42
+ [tool.setuptools.exclude-package-data]
43
+ "*" = ["tests", "*.tests", "*.tests.*"]