pyfluids 2.6.0__tar.gz → 2.7.2__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 (26) hide show
  1. {pyfluids-2.6.0 → pyfluids-2.7.2}/PKG-INFO +5 -6
  2. {pyfluids-2.6.0 → pyfluids-2.7.2}/PyPI.md +1 -1
  3. {pyfluids-2.6.0 → pyfluids-2.7.2}/pyfluids/fluids/abstract_fluid.py +32 -23
  4. {pyfluids-2.6.0 → pyfluids-2.7.2}/pyfluids/humid_air/humid_air.py +18 -15
  5. {pyfluids-2.6.0 → pyfluids-2.7.2}/pyproject.toml +11 -9
  6. {pyfluids-2.6.0 → pyfluids-2.7.2}/LICENSE +0 -0
  7. {pyfluids-2.6.0 → pyfluids-2.7.2}/pyfluids/__init__.py +0 -0
  8. {pyfluids-2.6.0 → pyfluids-2.7.2}/pyfluids/config/__init__.py +0 -0
  9. {pyfluids-2.6.0 → pyfluids-2.7.2}/pyfluids/config/pyfluids_config.py +0 -0
  10. {pyfluids-2.6.0 → pyfluids-2.7.2}/pyfluids/config/pyfluids_config_builder.py +0 -0
  11. {pyfluids-2.6.0 → pyfluids-2.7.2}/pyfluids/config/singleton.py +0 -0
  12. {pyfluids-2.6.0 → pyfluids-2.7.2}/pyfluids/config/unit_converter.py +0 -0
  13. {pyfluids-2.6.0 → pyfluids-2.7.2}/pyfluids/config/units_system.py +0 -0
  14. {pyfluids-2.6.0 → pyfluids-2.7.2}/pyfluids/enums/__init__.py +0 -0
  15. {pyfluids-2.6.0 → pyfluids-2.7.2}/pyfluids/enums/fluids_list.py +0 -0
  16. {pyfluids-2.6.0 → pyfluids-2.7.2}/pyfluids/enums/mix.py +0 -0
  17. {pyfluids-2.6.0 → pyfluids-2.7.2}/pyfluids/enums/phases.py +0 -0
  18. {pyfluids-2.6.0 → pyfluids-2.7.2}/pyfluids/fluids/__init__.py +0 -0
  19. {pyfluids-2.6.0 → pyfluids-2.7.2}/pyfluids/fluids/fluid.py +0 -0
  20. {pyfluids-2.6.0 → pyfluids-2.7.2}/pyfluids/fluids/mixture.py +0 -0
  21. {pyfluids-2.6.0 → pyfluids-2.7.2}/pyfluids/humid_air/__init__.py +0 -0
  22. {pyfluids-2.6.0 → pyfluids-2.7.2}/pyfluids/io/__init__.py +0 -0
  23. {pyfluids-2.6.0 → pyfluids-2.7.2}/pyfluids/io/abstract_input.py +0 -0
  24. {pyfluids-2.6.0 → pyfluids-2.7.2}/pyfluids/io/input.py +0 -0
  25. {pyfluids-2.6.0 → pyfluids-2.7.2}/pyfluids/io/input_humid_air.py +0 -0
  26. {pyfluids-2.6.0 → pyfluids-2.7.2}/pyfluids/io/outputs_validator.py +0 -0
@@ -1,13 +1,13 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pyfluids
3
- Version: 2.6.0
4
- Summary: A simple, full-featured, lightweight CoolProp wrapper for Python
3
+ Version: 2.7.2
4
+ Summary: Simple, full-featured, lightweight CoolProp wrapper for Python
5
5
  Home-page: https://github.com/portyanikhin/PyFluids
6
6
  License: MIT
7
7
  Keywords: CoolProp,fluids,mixtures,humid,air,thermophysical,properties,thermodynamics
8
8
  Author: Vladimir Portyanikhin
9
9
  Author-email: v.portyanikhin@ya.ru
10
- Requires-Python: >=3.7,<3.13
10
+ Requires-Python: >=3.8,<3.13
11
11
  Classifier: Development Status :: 5 - Production/Stable
12
12
  Classifier: Intended Audience :: Developers
13
13
  Classifier: Intended Audience :: Education
@@ -21,7 +21,6 @@ Classifier: Operating System :: POSIX :: Linux
21
21
  Classifier: Operating System :: Unix
22
22
  Classifier: Programming Language :: Python
23
23
  Classifier: Programming Language :: Python :: 3
24
- Classifier: Programming Language :: Python :: 3.7
25
24
  Classifier: Programming Language :: Python :: 3.8
26
25
  Classifier: Programming Language :: Python :: 3.9
27
26
  Classifier: Programming Language :: Python :: 3.10
@@ -36,7 +35,7 @@ Classifier: Topic :: Scientific/Engineering :: Atmospheric Science
36
35
  Classifier: Topic :: Scientific/Engineering :: Chemistry
37
36
  Classifier: Topic :: Scientific/Engineering :: Physics
38
37
  Requires-Dist: CoolProp (==6.6.0)
39
- Requires-Dist: tomli (==2.0.1)
38
+ Requires-Dist: tomli (==2.2.1)
40
39
  Project-URL: Documentation, https://github.com/portyanikhin/PyFluids
41
40
  Project-URL: Repository, https://github.com/portyanikhin/PyFluids
42
41
  Description-Content-Type: text/markdown
@@ -51,6 +50,6 @@ Description-Content-Type: text/markdown
51
50
  [![codecov](https://codecov.io/gh/portyanikhin/PyFluids/branch/main/graph/badge.svg?token=I1LL66AOJW)](https://codecov.io/gh/portyanikhin/PyFluids)
52
51
  [![Code style: black](https://img.shields.io/badge/code%20style-black-black)](https://github.com/psf/black)
53
52
 
54
- A simple, full-featured, lightweight [CoolProp](http://www.coolprop.org) wrapper for Python.
53
+ Simple, full-featured, lightweight [CoolProp](http://www.coolprop.org) wrapper for Python.
55
54
 
56
55
  _**See [full documentation](https://github.com/portyanikhin/PyFluids).**_
@@ -8,6 +8,6 @@
8
8
  [![codecov](https://codecov.io/gh/portyanikhin/PyFluids/branch/main/graph/badge.svg?token=I1LL66AOJW)](https://codecov.io/gh/portyanikhin/PyFluids)
9
9
  [![Code style: black](https://img.shields.io/badge/code%20style-black-black)](https://github.com/psf/black)
10
10
 
11
- A simple, full-featured, lightweight [CoolProp](http://www.coolprop.org) wrapper for Python.
11
+ Simple, full-featured, lightweight [CoolProp](http://www.coolprop.org) wrapper for Python.
12
12
 
13
13
  _**See [full documentation](https://github.com/portyanikhin/PyFluids).**_
@@ -45,6 +45,7 @@ class AbstractFluid(ABC):
45
45
  self.__temperature: float | None = None
46
46
  self.__triple_pressure: float | None = None
47
47
  self.__triple_temperature: float | None = None
48
+ self.__specified_phase: Phases | None = None
48
49
  self._unit_converter: UnitConverter = UnitConverter()
49
50
  self._fraction_unit: str = (
50
51
  " %" if self.units_system == UnitsSystem.SIWithCelsiusAndPercents else ""
@@ -321,6 +322,8 @@ class AbstractFluid(ABC):
321
322
  :raises ValueError: If input is invalid.
322
323
  """
323
324
  fluid = self.factory()
325
+ if self.__specified_phase is not None:
326
+ fluid.specify_phase(self.__specified_phase)
324
327
  fluid.update(first_input, second_input)
325
328
  return fluid
326
329
 
@@ -365,24 +368,30 @@ class AbstractFluid(ABC):
365
368
  self.__surface_tension = None
366
369
  self.__temperature = None
367
370
 
368
- def specify_phase(self, phase: Phases):
371
+ def specify_phase(self, phase: Phases) -> AbstractFluid:
369
372
  """
370
373
  Specify the phase state for all further calculations.
371
374
 
372
375
  :param phase: Phase state.
376
+ :return: Current fluid instance.
373
377
  """
374
378
  self._backend.specify_phase(phase.value)
379
+ self.__specified_phase = phase
380
+ return self
375
381
 
376
- def unspecify_phase(self):
382
+ def unspecify_phase(self) -> AbstractFluid:
377
383
  """
378
- Unspecify the phase state and
379
- go back to calculating it based on the inputs.
384
+ Unspecify the phase state and go back to calculating it based on the inputs.
385
+
386
+ :return: Current fluid instance.
380
387
  """
381
388
  self._backend.unspecify_phase()
389
+ self.__specified_phase = None
390
+ return self
382
391
 
383
392
  def isentropic_compression_to_pressure(self, pressure: float) -> AbstractFluid:
384
393
  """
385
- The process of isentropic compression to a given pressure.
394
+ The process of isentropic compression to given pressure.
386
395
 
387
396
  :param pressure: Absolute pressure [Pa].
388
397
  :return: The state of the fluid at the end of the process.
@@ -398,7 +407,7 @@ class AbstractFluid(ABC):
398
407
  self, pressure: float, isentropic_efficiency: float
399
408
  ) -> AbstractFluid:
400
409
  """
401
- The process of compression to a given pressure.
410
+ The process of compression to given pressure.
402
411
 
403
412
  :param pressure: Absolute pressure [Pa].
404
413
  :param isentropic_efficiency: Compressor isentropic efficiency
@@ -425,7 +434,7 @@ class AbstractFluid(ABC):
425
434
 
426
435
  def isenthalpic_expansion_to_pressure(self, pressure: float) -> AbstractFluid:
427
436
  """
428
- The process of isenthalpic expansion to a given pressure.
437
+ The process of isenthalpic expansion to given pressure.
429
438
 
430
439
  :param pressure: Absolute pressure [Pa].
431
440
  :return: The state of the fluid at the end of the process.
@@ -439,7 +448,7 @@ class AbstractFluid(ABC):
439
448
 
440
449
  def isentropic_expansion_to_pressure(self, pressure: float) -> AbstractFluid:
441
450
  """
442
- The process of isentropic expansion to a given pressure.
451
+ The process of isentropic expansion to given pressure.
443
452
 
444
453
  :param pressure: Absolute pressure [Pa].
445
454
  :return: The state of the fluid at the end of the process.
@@ -455,7 +464,7 @@ class AbstractFluid(ABC):
455
464
  self, pressure: float, isentropic_efficiency: float
456
465
  ) -> AbstractFluid:
457
466
  """
458
- The process of expansion to a given pressure.
467
+ The process of expansion to given pressure.
459
468
 
460
469
  :param pressure: Absolute pressure [Pa].
461
470
  :param isentropic_efficiency: Expander isentropic efficiency
@@ -484,7 +493,7 @@ class AbstractFluid(ABC):
484
493
  self, temperature: float, pressure_drop: float = 0
485
494
  ) -> AbstractFluid:
486
495
  """
487
- The process of cooling to a given temperature.
496
+ The process of cooling to given temperature.
488
497
 
489
498
  :param temperature: Temperature
490
499
  [by default, °C; you can change this using the configuration file].
@@ -502,7 +511,7 @@ class AbstractFluid(ABC):
502
511
  self, enthalpy: float, pressure_drop: float = 0
503
512
  ) -> AbstractFluid:
504
513
  """
505
- The process of cooling to a given enthalpy.
514
+ The process of cooling to given enthalpy.
506
515
 
507
516
  :param enthalpy: Enthalpy [J/kg].
508
517
  :param pressure_drop: Pressure drop in the heat exchanger (optional) [Pa].
@@ -519,7 +528,7 @@ class AbstractFluid(ABC):
519
528
  self, temperature: float, pressure_drop: float = 0
520
529
  ) -> AbstractFluid:
521
530
  """
522
- The process of heating to a given temperature.
531
+ The process of heating to given temperature.
523
532
 
524
533
  :param temperature: Temperature
525
534
  [by default, °C; you can change this using the configuration file].
@@ -537,7 +546,7 @@ class AbstractFluid(ABC):
537
546
  self, enthalpy: float, pressure_drop: float = 0
538
547
  ) -> AbstractFluid:
539
548
  """
540
- The process of heating to a given enthalpy.
549
+ The process of heating to given enthalpy.
541
550
 
542
551
  :param enthalpy: Enthalpy [J/kg].
543
552
  :param pressure_drop: Pressure drop in the heat exchanger (optional) [Pa].
@@ -552,29 +561,29 @@ class AbstractFluid(ABC):
552
561
 
553
562
  def bubble_point_at_pressure(self, pressure: float) -> AbstractFluid:
554
563
  """
555
- Bubble point at a given pressure.
564
+ Bubble point at given pressure.
556
565
 
557
566
  :param pressure: Absolute pressure [Pa].
558
- :return: Bubble point at a given pressure.
567
+ :return: Bubble point at given pressure.
559
568
  """
560
569
  return self.with_state(Input.pressure(pressure), Input.quality(0))
561
570
 
562
571
  def bubble_point_at_temperature(self, temperature: float) -> AbstractFluid:
563
572
  """
564
- Bubble point at a given temperature.
573
+ Bubble point at given temperature.
565
574
 
566
575
  :param temperature: Temperature
567
576
  [by default, °C; you can change this using the configuration file].
568
- :return: Bubble point at a given temperature.
577
+ :return: Bubble point at given temperature.
569
578
  """
570
579
  return self.with_state(Input.temperature(temperature), Input.quality(0))
571
580
 
572
581
  def dew_point_at_pressure(self, pressure: float) -> AbstractFluid:
573
582
  """
574
- Dew point at a given pressure.
583
+ Dew point at given pressure.
575
584
 
576
585
  :param pressure: Absolute pressure [Pa].
577
- :return: Dew point at a given pressure.
586
+ :return: Dew point at given pressure.
578
587
  """
579
588
  return self.with_state(
580
589
  Input.pressure(pressure),
@@ -585,11 +594,11 @@ class AbstractFluid(ABC):
585
594
 
586
595
  def dew_point_at_temperature(self, temperature: float) -> AbstractFluid:
587
596
  """
588
- Dew point at a given temperature.
597
+ Dew point at given temperature.
589
598
 
590
599
  :param temperature: Temperature
591
600
  [by default, °C; you can change this using the configuration file].
592
- :return: Dew point at a given temperature.
601
+ :return: Dew point at given temperature.
593
602
  """
594
603
  return self.with_state(
595
604
  Input.temperature(temperature),
@@ -602,12 +611,12 @@ class AbstractFluid(ABC):
602
611
  self, pressure: float, quality: float
603
612
  ) -> AbstractFluid:
604
613
  """
605
- Two phase point at a given pressure.
614
+ Two phase point at given pressure.
606
615
 
607
616
  :param pressure: Absolute pressure [Pa].
608
617
  :param quality: Vapor quality
609
618
  [by default, %; you can change this using the configuration file].
610
- :return: Two phase point at a given pressure.
619
+ :return: Two phase point at given pressure.
611
620
  """
612
621
  return self.with_state(Input.pressure(pressure), Input.quality(quality))
613
622
 
@@ -242,7 +242,7 @@ class HumidAir:
242
242
  self, temperature: float, pressure_drop: float = 0
243
243
  ) -> HumidAir:
244
244
  """
245
- The process of cooling without dehumidification to a given temperature.
245
+ The process of cooling without dehumidification to given temperature.
246
246
 
247
247
  :param temperature: Temperature
248
248
  [by default, °C; you can change this using the configuration file].
@@ -256,7 +256,7 @@ class HumidAir:
256
256
  self, enthalpy: float, pressure_drop: float = 0
257
257
  ) -> HumidAir:
258
258
  """
259
- The process of cooling without dehumidification to a given enthalpy.
259
+ The process of cooling without dehumidification to given enthalpy.
260
260
 
261
261
  :param enthalpy: Enthalpy [J/kg].
262
262
  :param pressure_drop: Pressure drop in the heat exchanger (optional) [Pa].
@@ -270,7 +270,7 @@ class HumidAir:
270
270
  ) -> HumidAir:
271
271
  """
272
272
  The process of cooling with dehumidification
273
- to a given temperature and relative humidity ratio.
273
+ to given temperature and relative humidity ratio.
274
274
 
275
275
  :param temperature: Temperature
276
276
  [by default, °C; you can change this using the configuration file].
@@ -292,7 +292,7 @@ class HumidAir:
292
292
  ) -> HumidAir:
293
293
  """
294
294
  The process of cooling with dehumidification
295
- to a given temperature and absolute humidity ratio.
295
+ to given temperature and absolute humidity ratio.
296
296
 
297
297
  :param temperature: Temperature
298
298
  [by default, °C; you can change this using the configuration file].
@@ -313,7 +313,7 @@ class HumidAir:
313
313
  ) -> HumidAir:
314
314
  """
315
315
  The process of cooling with dehumidification
316
- to a given enthalpy and relative humidity ratio.
316
+ to given enthalpy and relative humidity ratio.
317
317
 
318
318
  :param enthalpy: Enthalpy [J/kg].
319
319
  :param relative_humidity: Relative humidity ratio
@@ -334,7 +334,7 @@ class HumidAir:
334
334
  ) -> HumidAir:
335
335
  """
336
336
  The process of cooling with dehumidification
337
- to a given enthalpy and absolute humidity ratio.
337
+ to given enthalpy and absolute humidity ratio.
338
338
 
339
339
  :param enthalpy: Enthalpy [J/kg].
340
340
  :param humidity: Absolute humidity ratio [kg/kg d.a.].
@@ -353,7 +353,7 @@ class HumidAir:
353
353
  self, temperature: float, pressure_drop: float = 0
354
354
  ) -> HumidAir:
355
355
  """
356
- The process of heating to a given temperature.
356
+ The process of heating to given temperature.
357
357
 
358
358
  :param temperature: Temperature
359
359
  [by default, °C; you can change this using the configuration file].
@@ -369,7 +369,7 @@ class HumidAir:
369
369
  self, enthalpy: float, pressure_drop: float = 0
370
370
  ) -> HumidAir:
371
371
  """
372
- The process of heating to a given enthalpy.
372
+ The process of heating to given enthalpy.
373
373
 
374
374
  :param enthalpy: Enthalpy [J/kg].
375
375
  :param pressure_drop: Pressure drop in the heat exchanger (optional) [Pa].
@@ -383,7 +383,7 @@ class HumidAir:
383
383
  ) -> HumidAir:
384
384
  """
385
385
  The process of humidification by water (isenthalpic)
386
- to a given relative humidity ratio.
386
+ to given relative humidity ratio.
387
387
 
388
388
  :param relative_humidity: Relative humidity ratio
389
389
  [by default, %; you can change this using the configuration file].
@@ -398,7 +398,7 @@ class HumidAir:
398
398
  def humidification_by_water_to_absolute_humidity(self, humidity: float) -> HumidAir:
399
399
  """
400
400
  The process of humidification by water (isenthalpic)
401
- to a given absolute humidity ratio.
401
+ to given absolute humidity ratio.
402
402
 
403
403
  :param humidity: Absolute humidity ratio [kg/kg d.a.].
404
404
  :return: The state of the humid air at the end of the process.
@@ -414,7 +414,7 @@ class HumidAir:
414
414
  ) -> HumidAir:
415
415
  """
416
416
  The process of humidification by steam (isothermal)
417
- to a given relative humidity ratio.
417
+ to given relative humidity ratio.
418
418
 
419
419
  :param relative_humidity: Relative humidity ratio
420
420
  [by default, %; you can change this using the configuration file].
@@ -429,7 +429,7 @@ class HumidAir:
429
429
  def humidification_by_steam_to_absolute_humidity(self, humidity: float) -> HumidAir:
430
430
  """
431
431
  The process of humidification by steam (isothermal)
432
- to a given absolute humidity ratio.
432
+ to given absolute humidity ratio.
433
433
 
434
434
  :param humidity: Absolute humidity ratio [kg/kg d.a.].
435
435
  :return: The state of the humid air at the end of the process.
@@ -474,10 +474,13 @@ class HumidAir:
474
474
  ),
475
475
  InputHumidAir.humidity(
476
476
  (
477
- first_specific_mass_flow * first.humidity
478
- + second_specific_mass_flow * second.humidity
477
+ first_specific_mass_flow * first.humidity * (1 + second.humidity)
478
+ + second_specific_mass_flow * second.humidity * (1 + first.humidity)
479
+ )
480
+ / (
481
+ first_specific_mass_flow * (1 + second.humidity)
482
+ + second_specific_mass_flow * (1 + first.humidity)
479
483
  )
480
- / (first_specific_mass_flow + second_specific_mass_flow)
481
484
  ),
482
485
  )
483
486
 
@@ -1,7 +1,7 @@
1
1
  [tool.poetry]
2
2
  name = "pyfluids"
3
- version = "2.6.0"
4
- description = "A simple, full-featured, lightweight CoolProp wrapper for Python"
3
+ version = "2.7.2"
4
+ description = "Simple, full-featured, lightweight CoolProp wrapper for Python"
5
5
  authors = [
6
6
  "Vladimir Portyanikhin <v.portyanikhin@ya.ru>",
7
7
  ]
@@ -35,7 +35,6 @@ classifiers = [
35
35
  "Programming Language :: Python",
36
36
  "Programming Language :: Python :: 3",
37
37
  "Programming Language :: Python :: 3 :: Only",
38
- "Programming Language :: Python :: 3.7",
39
38
  "Programming Language :: Python :: 3.8",
40
39
  "Programming Language :: Python :: 3.9",
41
40
  "Programming Language :: Python :: 3.10",
@@ -54,15 +53,18 @@ packages = [
54
53
  ]
55
54
 
56
55
  [tool.poetry.dependencies]
57
- python = ">=3.7, <3.13"
56
+ python = ">=3.8, <3.13"
58
57
  CoolProp = "6.6.0"
59
- tomli = "2.0.1"
58
+ tomli = "2.2.1"
60
59
 
61
60
  [tool.poetry.group.test.dependencies]
62
- pytest = "7.4.3"
63
- pytest-asyncio = "0.21.1"
64
- pytest-cov = "4.1.0"
61
+ pytest = "8.3.4"
62
+ pytest-asyncio = "0.24.0"
63
+ pytest-cov = "5.0.0"
64
+
65
+ [tool.pytest.ini_options]
66
+ asyncio_default_fixture_loop_scope = "function"
65
67
 
66
68
  [build-system]
67
69
  requires = ["poetry-core"]
68
- build-backend = "poetry.core.masonry.api"
70
+ build-backend = "poetry.core.masonry.api"
File without changes
File without changes
File without changes
File without changes