open-fdd 0.1.0__tar.gz → 0.1.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 (105) hide show
  1. open_fdd-0.1.3/PKG-INFO +87 -0
  2. open_fdd-0.1.3/README.md +70 -0
  3. {open_fdd-0.1.0 → open_fdd-0.1.3}/open_fdd/air_handling_unit/faults/fault_condition.py +26 -8
  4. open_fdd-0.1.3/open_fdd/air_handling_unit/faults/fault_condition_eight.py +91 -0
  5. open_fdd-0.1.3/open_fdd/air_handling_unit/faults/fault_condition_eleven.py +90 -0
  6. open_fdd-0.1.3/open_fdd/air_handling_unit/faults/fault_condition_fifteen.py +116 -0
  7. open_fdd-0.1.3/open_fdd/air_handling_unit/faults/fault_condition_five.py +87 -0
  8. open_fdd-0.1.3/open_fdd/air_handling_unit/faults/fault_condition_four.py +136 -0
  9. open_fdd-0.1.3/open_fdd/air_handling_unit/faults/fault_condition_fourteen.py +107 -0
  10. open_fdd-0.1.3/open_fdd/air_handling_unit/faults/fault_condition_nine.py +92 -0
  11. open_fdd-0.1.3/open_fdd/air_handling_unit/faults/fault_condition_one.py +81 -0
  12. open_fdd-0.1.3/open_fdd/air_handling_unit/faults/fault_condition_seven.py +78 -0
  13. open_fdd-0.1.3/open_fdd/air_handling_unit/faults/fault_condition_six.py +144 -0
  14. open_fdd-0.1.3/open_fdd/air_handling_unit/faults/fault_condition_ten.py +87 -0
  15. open_fdd-0.1.3/open_fdd/air_handling_unit/faults/fault_condition_thirteen.py +91 -0
  16. open_fdd-0.1.3/open_fdd/air_handling_unit/faults/fault_condition_three.py +83 -0
  17. open_fdd-0.1.3/open_fdd/air_handling_unit/faults/fault_condition_twelve.py +95 -0
  18. open_fdd-0.1.3/open_fdd/air_handling_unit/faults/fault_condition_two.py +83 -0
  19. open_fdd-0.1.3/open_fdd/air_handling_unit/faults/helper_utils.py +421 -0
  20. {open_fdd-0.1.0 → open_fdd-0.1.3}/open_fdd/air_handling_unit/reports/report_fc7.py +3 -1
  21. {open_fdd-0.1.0 → open_fdd-0.1.3}/open_fdd/tests/ahu/test_ahu_fc1.py +17 -0
  22. open_fdd-0.1.3/open_fdd/tests/ahu/test_ahu_fc4.py +128 -0
  23. open_fdd-0.1.3/open_fdd.egg-info/PKG-INFO +87 -0
  24. {open_fdd-0.1.0 → open_fdd-0.1.3}/setup.py +3 -1
  25. open_fdd-0.1.0/PKG-INFO +0 -65
  26. open_fdd-0.1.0/README.md +0 -48
  27. open_fdd-0.1.0/open_fdd/air_handling_unit/faults/fault_condition_eight.py +0 -67
  28. open_fdd-0.1.0/open_fdd/air_handling_unit/faults/fault_condition_eleven.py +0 -68
  29. open_fdd-0.1.0/open_fdd/air_handling_unit/faults/fault_condition_fifteen.py +0 -90
  30. open_fdd-0.1.0/open_fdd/air_handling_unit/faults/fault_condition_five.py +0 -68
  31. open_fdd-0.1.0/open_fdd/air_handling_unit/faults/fault_condition_four.py +0 -93
  32. open_fdd-0.1.0/open_fdd/air_handling_unit/faults/fault_condition_fourteen.py +0 -80
  33. open_fdd-0.1.0/open_fdd/air_handling_unit/faults/fault_condition_nine.py +0 -68
  34. open_fdd-0.1.0/open_fdd/air_handling_unit/faults/fault_condition_one.py +0 -60
  35. open_fdd-0.1.0/open_fdd/air_handling_unit/faults/fault_condition_seven.py +0 -55
  36. open_fdd-0.1.0/open_fdd/air_handling_unit/faults/fault_condition_six.py +0 -120
  37. open_fdd-0.1.0/open_fdd/air_handling_unit/faults/fault_condition_ten.py +0 -62
  38. open_fdd-0.1.0/open_fdd/air_handling_unit/faults/fault_condition_thirteen.py +0 -66
  39. open_fdd-0.1.0/open_fdd/air_handling_unit/faults/fault_condition_three.py +0 -58
  40. open_fdd-0.1.0/open_fdd/air_handling_unit/faults/fault_condition_twelve.py +0 -71
  41. open_fdd-0.1.0/open_fdd/air_handling_unit/faults/fault_condition_two.py +0 -61
  42. open_fdd-0.1.0/open_fdd/air_handling_unit/faults/helper_utils.py +0 -191
  43. open_fdd-0.1.0/open_fdd/tests/ahu/test_ahu_fc4.py +0 -200
  44. open_fdd-0.1.0/open_fdd.egg-info/PKG-INFO +0 -65
  45. {open_fdd-0.1.0 → open_fdd-0.1.3}/LICENSE +0 -0
  46. {open_fdd-0.1.0 → open_fdd-0.1.3}/MANIFEST.in +0 -0
  47. {open_fdd-0.1.0 → open_fdd-0.1.3}/open_fdd/__init__.py +0 -0
  48. {open_fdd-0.1.0 → open_fdd-0.1.3}/open_fdd/air_handling_unit/__init__.py +0 -0
  49. {open_fdd-0.1.0 → open_fdd-0.1.3}/open_fdd/air_handling_unit/faults/__init__.py +0 -0
  50. {open_fdd-0.1.0 → open_fdd-0.1.3}/open_fdd/air_handling_unit/faults/shared_utils.py +0 -0
  51. {open_fdd-0.1.0 → open_fdd-0.1.3}/open_fdd/air_handling_unit/images/example1.jpg +0 -0
  52. {open_fdd-0.1.0 → open_fdd-0.1.3}/open_fdd/air_handling_unit/images/example2.jpg +0 -0
  53. {open_fdd-0.1.0 → open_fdd-0.1.3}/open_fdd/air_handling_unit/images/fc10_definition.png +0 -0
  54. {open_fdd-0.1.0 → open_fdd-0.1.3}/open_fdd/air_handling_unit/images/fc11_definition.png +0 -0
  55. {open_fdd-0.1.0 → open_fdd-0.1.3}/open_fdd/air_handling_unit/images/fc12_definition.png +0 -0
  56. {open_fdd-0.1.0 → open_fdd-0.1.3}/open_fdd/air_handling_unit/images/fc13_definition.png +0 -0
  57. {open_fdd-0.1.0 → open_fdd-0.1.3}/open_fdd/air_handling_unit/images/fc1_definition.png +0 -0
  58. {open_fdd-0.1.0 → open_fdd-0.1.3}/open_fdd/air_handling_unit/images/fc1_report_screenshot_all.png +0 -0
  59. {open_fdd-0.1.0 → open_fdd-0.1.3}/open_fdd/air_handling_unit/images/fc2_definition.png +0 -0
  60. {open_fdd-0.1.0 → open_fdd-0.1.3}/open_fdd/air_handling_unit/images/fc3_definition.png +0 -0
  61. {open_fdd-0.1.0 → open_fdd-0.1.3}/open_fdd/air_handling_unit/images/fc4_definition.png +0 -0
  62. {open_fdd-0.1.0 → open_fdd-0.1.3}/open_fdd/air_handling_unit/images/fc5_definition.png +0 -0
  63. {open_fdd-0.1.0 → open_fdd-0.1.3}/open_fdd/air_handling_unit/images/fc6_definition.png +0 -0
  64. {open_fdd-0.1.0 → open_fdd-0.1.3}/open_fdd/air_handling_unit/images/fc7_definition.png +0 -0
  65. {open_fdd-0.1.0 → open_fdd-0.1.3}/open_fdd/air_handling_unit/images/fc8_definition.png +0 -0
  66. {open_fdd-0.1.0 → open_fdd-0.1.3}/open_fdd/air_handling_unit/images/fc9_definition.png +0 -0
  67. {open_fdd-0.1.0 → open_fdd-0.1.3}/open_fdd/air_handling_unit/images/latex_generator.py +0 -0
  68. {open_fdd-0.1.0 → open_fdd-0.1.3}/open_fdd/air_handling_unit/images/params.docx +0 -0
  69. {open_fdd-0.1.0 → open_fdd-0.1.3}/open_fdd/air_handling_unit/images/params.pdf +0 -0
  70. {open_fdd-0.1.0 → open_fdd-0.1.3}/open_fdd/air_handling_unit/images/plot_for_repo.png +0 -0
  71. {open_fdd-0.1.0 → open_fdd-0.1.3}/open_fdd/air_handling_unit/reports/__init__.py +0 -0
  72. {open_fdd-0.1.0 → open_fdd-0.1.3}/open_fdd/air_handling_unit/reports/report_fc1.py +0 -0
  73. {open_fdd-0.1.0 → open_fdd-0.1.3}/open_fdd/air_handling_unit/reports/report_fc10.py +0 -0
  74. {open_fdd-0.1.0 → open_fdd-0.1.3}/open_fdd/air_handling_unit/reports/report_fc11.py +0 -0
  75. {open_fdd-0.1.0 → open_fdd-0.1.3}/open_fdd/air_handling_unit/reports/report_fc12.py +0 -0
  76. {open_fdd-0.1.0 → open_fdd-0.1.3}/open_fdd/air_handling_unit/reports/report_fc13.py +0 -0
  77. {open_fdd-0.1.0 → open_fdd-0.1.3}/open_fdd/air_handling_unit/reports/report_fc14.py +0 -0
  78. {open_fdd-0.1.0 → open_fdd-0.1.3}/open_fdd/air_handling_unit/reports/report_fc15.py +0 -0
  79. {open_fdd-0.1.0 → open_fdd-0.1.3}/open_fdd/air_handling_unit/reports/report_fc2.py +0 -0
  80. {open_fdd-0.1.0 → open_fdd-0.1.3}/open_fdd/air_handling_unit/reports/report_fc3.py +0 -0
  81. {open_fdd-0.1.0 → open_fdd-0.1.3}/open_fdd/air_handling_unit/reports/report_fc4.py +0 -0
  82. {open_fdd-0.1.0 → open_fdd-0.1.3}/open_fdd/air_handling_unit/reports/report_fc5.py +0 -0
  83. {open_fdd-0.1.0 → open_fdd-0.1.3}/open_fdd/air_handling_unit/reports/report_fc6.py +0 -0
  84. {open_fdd-0.1.0 → open_fdd-0.1.3}/open_fdd/air_handling_unit/reports/report_fc8.py +0 -0
  85. {open_fdd-0.1.0 → open_fdd-0.1.3}/open_fdd/air_handling_unit/reports/report_fc9.py +0 -0
  86. {open_fdd-0.1.0 → open_fdd-0.1.3}/open_fdd/tests/__init__.py +0 -0
  87. {open_fdd-0.1.0 → open_fdd-0.1.3}/open_fdd/tests/ahu/__init__.py +0 -0
  88. {open_fdd-0.1.0 → open_fdd-0.1.3}/open_fdd/tests/ahu/test_ahu_fc10.py +0 -0
  89. {open_fdd-0.1.0 → open_fdd-0.1.3}/open_fdd/tests/ahu/test_ahu_fc11.py +0 -0
  90. {open_fdd-0.1.0 → open_fdd-0.1.3}/open_fdd/tests/ahu/test_ahu_fc12.py +0 -0
  91. {open_fdd-0.1.0 → open_fdd-0.1.3}/open_fdd/tests/ahu/test_ahu_fc13.py +0 -0
  92. {open_fdd-0.1.0 → open_fdd-0.1.3}/open_fdd/tests/ahu/test_ahu_fc14.py +0 -0
  93. {open_fdd-0.1.0 → open_fdd-0.1.3}/open_fdd/tests/ahu/test_ahu_fc15.py +0 -0
  94. {open_fdd-0.1.0 → open_fdd-0.1.3}/open_fdd/tests/ahu/test_ahu_fc2.py +0 -0
  95. {open_fdd-0.1.0 → open_fdd-0.1.3}/open_fdd/tests/ahu/test_ahu_fc3.py +0 -0
  96. {open_fdd-0.1.0 → open_fdd-0.1.3}/open_fdd/tests/ahu/test_ahu_fc5.py +0 -0
  97. {open_fdd-0.1.0 → open_fdd-0.1.3}/open_fdd/tests/ahu/test_ahu_fc6.py +0 -0
  98. {open_fdd-0.1.0 → open_fdd-0.1.3}/open_fdd/tests/ahu/test_ahu_fc7.py +0 -0
  99. {open_fdd-0.1.0 → open_fdd-0.1.3}/open_fdd/tests/ahu/test_ahu_fc8.py +0 -0
  100. {open_fdd-0.1.0 → open_fdd-0.1.3}/open_fdd/tests/ahu/test_ahu_fc9.py +0 -0
  101. {open_fdd-0.1.0 → open_fdd-0.1.3}/open_fdd.egg-info/SOURCES.txt +0 -0
  102. {open_fdd-0.1.0 → open_fdd-0.1.3}/open_fdd.egg-info/dependency_links.txt +0 -0
  103. {open_fdd-0.1.0 → open_fdd-0.1.3}/open_fdd.egg-info/requires.txt +0 -0
  104. {open_fdd-0.1.0 → open_fdd-0.1.3}/open_fdd.egg-info/top_level.txt +0 -0
  105. {open_fdd-0.1.0 → open_fdd-0.1.3}/setup.cfg +0 -0
@@ -0,0 +1,87 @@
1
+ Metadata-Version: 2.1
2
+ Name: open_fdd
3
+ Version: 0.1.3
4
+ Summary: A package for fault detection and diagnosis in HVAC systems
5
+ Home-page: https://github.com/bbartling/open-fdd
6
+ Author: Ben Bartling
7
+ Author-email: ben.bartling@gmail.com
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: License :: OSI Approved :: MIT License
10
+ Classifier: Operating System :: OS Independent
11
+ Requires-Python: >=3.6
12
+ Description-Content-Type: text/markdown
13
+ License-File: LICENSE
14
+ Requires-Dist: pandas
15
+ Requires-Dist: matplotlib
16
+ Requires-Dist: pytest
17
+
18
+ # open-fdd
19
+
20
+ ![CI](https://github.com/bbartling/open-fdd/actions/workflows/ci.yml/badge.svg?branch=master)
21
+ ![MIT License](https://img.shields.io/badge/license-MIT-green.svg)
22
+ ![Black](https://img.shields.io/badge/code%20style-black-000000.svg)
23
+ ![PyPI](https://img.shields.io/pypi/v/open-fdd?color=blue&label=pypi%20version)
24
+
25
+
26
+ ![Alt text](https://raw.githubusercontent.com/bbartling/open-fdd/master/open_fdd/air_handling_unit/images/plot_for_repo.png)
27
+
28
+
29
+ This is a Python-based Fault Detection and Diagnostics (FDD) tool for running fault equations inspired by ASHRAE and NIST standards for HVAC systems across historical datasets using the Pandas computing library. The tool evaluates various fault conditions and outputs fault flags as boolean columns within typical Pandas DataFrames. These fault flags indicate the presence (True) or absence (False) of specific issues identified by the fault equations. This approach integrates seamlessly into standard data science and computer science workflows, allowing for efficient analysis, visualization, and further processing of fault conditions within familiar data structures like DataFrames.
30
+
31
+
32
+ ## Getting Setup
33
+ This project is now available on PyPI, making it easy to set up with the Python package manager, pip. You can install the package using the following command:
34
+
35
+ ```bash
36
+ pip install open-fdd
37
+ ```
38
+
39
+ For running Jupyter notebooks, I recommend using Visual Studio Code with the Jupyter notebook extension installed, which offers a seamless experience directly within the editor. Be sure to explore the `examples` directory for Jupyter notebook tutorials. If you have your own FDD experiences to share, feel free to contribute by creating a notebook (`.ipynb`). You’re welcome to reach out to me directly, and I can push your example to GitHub on your behalf, which might be a simpler process than submitting a pull request (PR), especially if you're just sharing an example rather than developing `open-fdd`.
40
+
41
+ ## Project goals
42
+ These are some basic project goals to make this into an interactive FDD application.
43
+ - [x] finish `air_handling_unit` faults and reports based on ASHRAE and NIST
44
+ - [x] publish to PyPI as Python library
45
+ - [ ] make a few IPython notebook tutorials AHU FDD examples with `BRICK` meta data integration.
46
+ - [ ] make a guide for fault `parameters` like error thresholds, etc.
47
+ - [ ] make `central_plant` faults, IPython reports, and examples.
48
+ - [ ] make `energy_efficiency` faults, IPython reports, and examples to `optimize` in reducing energy consumption.
49
+ - [ ] make `metering`, faults, IPython reports, and examples to possibly model utility metering data.
50
+ - [ ] create SQL example to read data from time series db and write back to SQL to then read faults in Grafana.
51
+ - [ ] other?
52
+
53
+ Certainly! Here's a revised version of your contribution guidelines:
54
+
55
+ ## Contribute
56
+
57
+ If you have suggestions for improving developer best practices or solutions, please feel free to reach out to me directly using my contact information or Git issue/discussion. I primarily work on Windows with multiple versions of Python installed, with Python 3.12.x as my default version. You can download the latest version of Python here:
58
+ * https://www.python.org/downloads/
59
+
60
+ 1. **Adding New Faults and Reports:**
61
+ Developers will need to `> py -3.12 -m pip install black pytest`. When adding new faults and reports, I usually run `> py -3.12 -m pip install .` in the cloned project directory. I continuously uninstall with `> py -3.12 -m pip uninstall open-fdd` and reinstall locally until I'm satisfied with the changes.
62
+
63
+ 2. **Testing Fault Logic:**
64
+ All fault logic is rigorously tested using `pytest`. You can run the tests with `> py -m pytest`.
65
+
66
+ 3. **Formatting with Black:**
67
+ To ensure code consistency, I use Black for formatting. Run `> py -m black .` to format the code and check it with `> py -m black --check .`
68
+
69
+ 4. **Pushing to GitHub:**
70
+ After making changes, and the steps above are successful push them to GitHub in a pull request. The GitHub Actions workflow will automatically run `pytest` and `black` to ensure the build is successful.
71
+
72
+
73
+ This project is a community-driven initiative, focusing on the development of free and open-source tools. I believe that Fault Detection and Diagnostics (FDD) should be free and accessible to anyone who wants to try it out, embodying the spirit of open-source philosophy. Additionally, this project aims to serve as an educational resource, empowering individuals to learn about and implement FDD in their own systems. As someone wisely said, `"Knowledge should be shared, not hoarded,"` and this project strives to put that wisdom into practice.
74
+
75
+ Got any ideas or questions? Submit a Git issue or start a Discussion...
76
+
77
+ ## License
78
+
79
+ 【MIT License】
80
+
81
+ Copyright 2024 Ben Bartling
82
+
83
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
84
+
85
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
86
+
87
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,70 @@
1
+ # open-fdd
2
+
3
+ ![CI](https://github.com/bbartling/open-fdd/actions/workflows/ci.yml/badge.svg?branch=master)
4
+ ![MIT License](https://img.shields.io/badge/license-MIT-green.svg)
5
+ ![Black](https://img.shields.io/badge/code%20style-black-000000.svg)
6
+ ![PyPI](https://img.shields.io/pypi/v/open-fdd?color=blue&label=pypi%20version)
7
+
8
+
9
+ ![Alt text](https://raw.githubusercontent.com/bbartling/open-fdd/master/open_fdd/air_handling_unit/images/plot_for_repo.png)
10
+
11
+
12
+ This is a Python-based Fault Detection and Diagnostics (FDD) tool for running fault equations inspired by ASHRAE and NIST standards for HVAC systems across historical datasets using the Pandas computing library. The tool evaluates various fault conditions and outputs fault flags as boolean columns within typical Pandas DataFrames. These fault flags indicate the presence (True) or absence (False) of specific issues identified by the fault equations. This approach integrates seamlessly into standard data science and computer science workflows, allowing for efficient analysis, visualization, and further processing of fault conditions within familiar data structures like DataFrames.
13
+
14
+
15
+ ## Getting Setup
16
+ This project is now available on PyPI, making it easy to set up with the Python package manager, pip. You can install the package using the following command:
17
+
18
+ ```bash
19
+ pip install open-fdd
20
+ ```
21
+
22
+ For running Jupyter notebooks, I recommend using Visual Studio Code with the Jupyter notebook extension installed, which offers a seamless experience directly within the editor. Be sure to explore the `examples` directory for Jupyter notebook tutorials. If you have your own FDD experiences to share, feel free to contribute by creating a notebook (`.ipynb`). You’re welcome to reach out to me directly, and I can push your example to GitHub on your behalf, which might be a simpler process than submitting a pull request (PR), especially if you're just sharing an example rather than developing `open-fdd`.
23
+
24
+ ## Project goals
25
+ These are some basic project goals to make this into an interactive FDD application.
26
+ - [x] finish `air_handling_unit` faults and reports based on ASHRAE and NIST
27
+ - [x] publish to PyPI as Python library
28
+ - [ ] make a few IPython notebook tutorials AHU FDD examples with `BRICK` meta data integration.
29
+ - [ ] make a guide for fault `parameters` like error thresholds, etc.
30
+ - [ ] make `central_plant` faults, IPython reports, and examples.
31
+ - [ ] make `energy_efficiency` faults, IPython reports, and examples to `optimize` in reducing energy consumption.
32
+ - [ ] make `metering`, faults, IPython reports, and examples to possibly model utility metering data.
33
+ - [ ] create SQL example to read data from time series db and write back to SQL to then read faults in Grafana.
34
+ - [ ] other?
35
+
36
+ Certainly! Here's a revised version of your contribution guidelines:
37
+
38
+ ## Contribute
39
+
40
+ If you have suggestions for improving developer best practices or solutions, please feel free to reach out to me directly using my contact information or Git issue/discussion. I primarily work on Windows with multiple versions of Python installed, with Python 3.12.x as my default version. You can download the latest version of Python here:
41
+ * https://www.python.org/downloads/
42
+
43
+ 1. **Adding New Faults and Reports:**
44
+ Developers will need to `> py -3.12 -m pip install black pytest`. When adding new faults and reports, I usually run `> py -3.12 -m pip install .` in the cloned project directory. I continuously uninstall with `> py -3.12 -m pip uninstall open-fdd` and reinstall locally until I'm satisfied with the changes.
45
+
46
+ 2. **Testing Fault Logic:**
47
+ All fault logic is rigorously tested using `pytest`. You can run the tests with `> py -m pytest`.
48
+
49
+ 3. **Formatting with Black:**
50
+ To ensure code consistency, I use Black for formatting. Run `> py -m black .` to format the code and check it with `> py -m black --check .`
51
+
52
+ 4. **Pushing to GitHub:**
53
+ After making changes, and the steps above are successful push them to GitHub in a pull request. The GitHub Actions workflow will automatically run `pytest` and `black` to ensure the build is successful.
54
+
55
+
56
+ This project is a community-driven initiative, focusing on the development of free and open-source tools. I believe that Fault Detection and Diagnostics (FDD) should be free and accessible to anyone who wants to try it out, embodying the spirit of open-source philosophy. Additionally, this project aims to serve as an educational resource, empowering individuals to learn about and implement FDD in their own systems. As someone wisely said, `"Knowledge should be shared, not hoarded,"` and this project strives to put that wisdom into practice.
57
+
58
+ Got any ideas or questions? Submit a Git issue or start a Discussion...
59
+
60
+ ## License
61
+
62
+ 【MIT License】
63
+
64
+ Copyright 2024 Ben Bartling
65
+
66
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
67
+
68
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
69
+
70
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -1,21 +1,39 @@
1
+ import pandas as pd
1
2
  import pandas.api.types as pdtypes
2
3
  from open_fdd.air_handling_unit.faults.helper_utils import HelperUtils
3
4
  import sys
4
5
 
5
6
 
7
+ class MissingColumnError(Exception):
8
+ """Custom exception raised when a required column is missing or None."""
9
+
10
+ def __init__(self, message):
11
+ self.message = message
12
+ super().__init__(self.message)
13
+
14
+
6
15
  class FaultCondition:
7
16
  """Parent class for Fault Conditions. Methods are inherited to all children."""
8
17
 
9
- def set_attributes(self, dict_):
10
- """Passes dictionary into initialization of class instance, then uses the attributes called out below in
11
- attributes_dict to set only the attributes that match from dict_.
18
+ def __init__(self):
19
+ self.required_columns = []
12
20
 
13
- :param dict_: dictionary of all possible class attributes (loaded from config file)
14
- """
15
- for attribute in self.__dict__:
21
+ def set_attributes(self, dict_):
22
+ """Passes dictionary into initialization of class instance"""
23
+ for attribute in self.__dict__.keys():
16
24
  upper = attribute.upper()
17
- value = dict_[upper]
18
- self.__setattr__(attribute, value)
25
+ if upper in dict_:
26
+ value = dict_[upper]
27
+ self.__setattr__(attribute, value)
28
+
29
+ def check_required_columns(self, df: pd.DataFrame):
30
+ """Checks if required columns are present in the DataFrame."""
31
+ missing_columns = [
32
+ col for col in self.required_columns if col is None or col not in df.columns
33
+ ]
34
+
35
+ if missing_columns:
36
+ raise MissingColumnError(f"Missing required columns: {missing_columns}")
19
37
 
20
38
  def troubleshoot_cols(self, df):
21
39
  """print troubleshoot columns mapping
@@ -0,0 +1,91 @@
1
+ import pandas as pd
2
+ import numpy as np
3
+ from open_fdd.air_handling_unit.faults.fault_condition import (
4
+ FaultCondition,
5
+ MissingColumnError,
6
+ )
7
+ import sys
8
+
9
+
10
+ class FaultConditionEight(FaultCondition):
11
+ """Class provides the definitions for Fault Condition 8.
12
+ Supply air temperature and mix air temperature should
13
+ be approx equal in economizer mode.
14
+ """
15
+
16
+ def __init__(self, dict_):
17
+ super().__init__()
18
+ self.delta_t_supply_fan = float
19
+ self.mix_degf_err_thres = float
20
+ self.supply_degf_err_thres = float
21
+ self.ahu_min_oa_dpr = float
22
+ self.mat_col = str
23
+ self.sat_col = str
24
+ self.economizer_sig_col = str
25
+ self.cooling_sig_col = str
26
+ self.troubleshoot_mode = bool # default should be False
27
+ self.rolling_window_size = int
28
+
29
+ self.set_attributes(dict_)
30
+
31
+ # Set required columns specific to this fault condition
32
+ self.required_columns = [
33
+ self.mat_col,
34
+ self.sat_col,
35
+ self.economizer_sig_col,
36
+ self.cooling_sig_col,
37
+ ]
38
+
39
+ def get_required_columns(self) -> str:
40
+ """Returns a string representation of the required columns."""
41
+ return f"Required columns for FaultConditionEight: {', '.join(self.required_columns)}"
42
+
43
+ def apply(self, df: pd.DataFrame) -> pd.DataFrame:
44
+ try:
45
+ # Ensure all required columns are present
46
+ self.check_required_columns(df)
47
+
48
+ if self.troubleshoot_mode:
49
+ self.troubleshoot_cols(df)
50
+
51
+ # Check analog outputs [data with units of %] are floats only
52
+ columns_to_check = [
53
+ self.economizer_sig_col,
54
+ self.cooling_sig_col,
55
+ ]
56
+
57
+ self.check_analog_pct(df, columns_to_check)
58
+
59
+ df["sat_fan_mat"] = abs(
60
+ df[self.sat_col] - self.delta_t_supply_fan - df[self.mat_col]
61
+ )
62
+ df["sat_mat_sqrted"] = np.sqrt(
63
+ self.supply_degf_err_thres**2 + self.mix_degf_err_thres**2
64
+ )
65
+
66
+ df["combined_check"] = (
67
+ (df["sat_fan_mat"] > df["sat_mat_sqrted"])
68
+ & (df[self.economizer_sig_col] > self.ahu_min_oa_dpr)
69
+ & (df[self.cooling_sig_col] < 0.1)
70
+ )
71
+
72
+ # Rolling sum to count consecutive trues
73
+ rolling_sum = (
74
+ df["combined_check"].rolling(window=self.rolling_window_size).sum()
75
+ )
76
+ # Set flag to 1 if rolling sum equals the window size
77
+ df["fc8_flag"] = (rolling_sum >= self.rolling_window_size).astype(int)
78
+
79
+ if self.troubleshoot_mode:
80
+ print("Troubleshoot mode enabled - not removing helper columns")
81
+ sys.stdout.flush()
82
+ del df["sat_fan_mat"]
83
+ del df["sat_mat_sqrted"]
84
+ del df["combined_check"]
85
+
86
+ return df
87
+
88
+ except MissingColumnError as e:
89
+ print(f"Error: {e.message}")
90
+ sys.stdout.flush()
91
+ raise e # Re-raise the exception so it can be caught by pytest
@@ -0,0 +1,90 @@
1
+ import pandas as pd
2
+ from open_fdd.air_handling_unit.faults.fault_condition import (
3
+ FaultCondition,
4
+ MissingColumnError,
5
+ )
6
+ import sys
7
+
8
+
9
+ class FaultConditionEleven(FaultCondition):
10
+ """Class provides the definitions for Fault Condition 11.
11
+ Outside air temperature too low for 100% outdoor
12
+ air cooling in economizer cooling mode.
13
+ Economizer performance fault
14
+ """
15
+
16
+ def __init__(self, dict_):
17
+ super().__init__()
18
+ self.delta_t_supply_fan = float
19
+ self.outdoor_degf_err_thres = float
20
+ self.supply_degf_err_thres = float
21
+ self.sat_setpoint_col = str
22
+ self.oat_col = str
23
+ self.cooling_sig_col = str
24
+ self.economizer_sig_col = str
25
+ self.troubleshoot_mode = bool # default False
26
+ self.rolling_window_size = int
27
+
28
+ self.set_attributes(dict_)
29
+
30
+ # Set required columns specific to this fault condition
31
+ self.required_columns = [
32
+ self.sat_setpoint_col,
33
+ self.oat_col,
34
+ self.cooling_sig_col,
35
+ self.economizer_sig_col,
36
+ ]
37
+
38
+ def get_required_columns(self) -> str:
39
+ """Returns a string representation of the required columns."""
40
+ return f"Required columns for FaultConditionEleven: {', '.join(self.required_columns)}"
41
+
42
+ def apply(self, df: pd.DataFrame) -> pd.DataFrame:
43
+ try:
44
+ # Ensure all required columns are present
45
+ self.check_required_columns(df)
46
+
47
+ if self.troubleshoot_mode:
48
+ self.troubleshoot_cols(df)
49
+
50
+ # Check analog outputs [data with units of %] are floats only
51
+ columns_to_check = [
52
+ self.economizer_sig_col,
53
+ self.cooling_sig_col,
54
+ ]
55
+ self.check_analog_pct(df, columns_to_check)
56
+
57
+ df["oat_plus_oaterror"] = df[self.oat_col] + self.outdoor_degf_err_thres
58
+ df["satsp_delta_saterr"] = (
59
+ df[self.sat_setpoint_col]
60
+ - self.delta_t_supply_fan
61
+ - self.supply_degf_err_thres
62
+ )
63
+
64
+ df["combined_check"] = (
65
+ (df["oat_plus_oaterror"] < df["satsp_delta_saterr"])
66
+ # verify ahu is running in OS 3 clg mode in 100 OA
67
+ & (df[self.cooling_sig_col] > 0.01)
68
+ & (df[self.economizer_sig_col] > 0.9)
69
+ )
70
+
71
+ # Rolling sum to count consecutive trues
72
+ rolling_sum = (
73
+ df["combined_check"].rolling(window=self.rolling_window_size).sum()
74
+ )
75
+ # Set flag to 1 if rolling sum equals the window size
76
+ df["fc11_flag"] = (rolling_sum >= self.rolling_window_size).astype(int)
77
+
78
+ if self.troubleshoot_mode:
79
+ print("Troubleshoot mode enabled - not removing helper columns")
80
+ sys.stdout.flush()
81
+ del df["oat_plus_oaterror"]
82
+ del df["satsp_delta_saterr"]
83
+ del df["combined_check"]
84
+
85
+ return df
86
+
87
+ except MissingColumnError as e:
88
+ print(f"Error: {e.message}")
89
+ sys.stdout.flush()
90
+ raise e # Re-raise the exception so it can be caught by pytest
@@ -0,0 +1,116 @@
1
+ import pandas as pd
2
+ import numpy as np
3
+ from open_fdd.air_handling_unit.faults.fault_condition import (
4
+ FaultCondition,
5
+ MissingColumnError,
6
+ )
7
+ import sys
8
+
9
+
10
+ class FaultConditionFifteen(FaultCondition):
11
+ """Class provides the definitions for Fault Condition 15.
12
+ Temperature rise across inactive heating coil.
13
+ Requires coil leaving temp sensor.
14
+ """
15
+
16
+ def __init__(self, dict_):
17
+ super().__init__()
18
+ self.delta_supply_fan = float
19
+ self.coil_temp_enter_err_thres = float
20
+ self.coil_temp_leav_err_thres = float
21
+ self.htg_coil_enter_temp_col = str
22
+ self.htg_coil_leave_temp_col = str
23
+ self.ahu_min_oa_dpr = float
24
+ self.cooling_sig_col = str
25
+ self.heating_sig_col = str
26
+ self.economizer_sig_col = str
27
+ self.supply_vfd_speed_col = str
28
+ self.troubleshoot_mode = bool # default to False
29
+ self.rolling_window_size = int
30
+
31
+ self.set_attributes(dict_)
32
+
33
+ # Set required columns specific to this fault condition
34
+ self.required_columns = [
35
+ self.htg_coil_enter_temp_col,
36
+ self.htg_coil_leave_temp_col,
37
+ self.cooling_sig_col,
38
+ self.heating_sig_col,
39
+ self.economizer_sig_col,
40
+ self.supply_vfd_speed_col,
41
+ ]
42
+
43
+ def get_required_columns(self) -> str:
44
+ """Returns a string representation of the required columns."""
45
+ return f"Required columns for FaultConditionFifteen: {', '.join(self.required_columns)}"
46
+
47
+ def apply(self, df: pd.DataFrame) -> pd.DataFrame:
48
+ try:
49
+ # Ensure all required columns are present
50
+ self.check_required_columns(df)
51
+
52
+ if self.troubleshoot_mode:
53
+ self.troubleshoot_cols(df)
54
+
55
+ # Check analog outputs [data with units of %] are floats only
56
+ columns_to_check = [
57
+ self.economizer_sig_col,
58
+ self.cooling_sig_col,
59
+ self.heating_sig_col,
60
+ self.supply_vfd_speed_col,
61
+ ]
62
+ self.check_analog_pct(df, columns_to_check)
63
+
64
+ # Create helper columns
65
+ df["htg_delta_temp"] = (
66
+ df[self.htg_coil_leave_temp_col] - df[self.htg_coil_enter_temp_col]
67
+ )
68
+
69
+ df["htg_delta_sqrted"] = (
70
+ np.sqrt(
71
+ self.coil_temp_enter_err_thres**2 + self.coil_temp_leav_err_thres**2
72
+ )
73
+ + self.delta_supply_fan
74
+ )
75
+
76
+ df["combined_check"] = (
77
+ (
78
+ (df["htg_delta_temp"] >= df["htg_delta_sqrted"])
79
+ # verify AHU is in OS2 only free cooling mode
80
+ & (df[self.economizer_sig_col] > self.ahu_min_oa_dpr)
81
+ & (df[self.cooling_sig_col] < 0.1)
82
+ )
83
+ | (
84
+ (df["htg_delta_temp"] >= df["htg_delta_sqrted"])
85
+ # OS4 AHU state clg @ min OA
86
+ & (df[self.cooling_sig_col] > 0.01)
87
+ & (df[self.economizer_sig_col] == self.ahu_min_oa_dpr)
88
+ )
89
+ | (
90
+ (df["htg_delta_temp"] >= df["htg_delta_sqrted"])
91
+ # verify AHU is running in OS 3 clg mode in 100 OA
92
+ & (df[self.cooling_sig_col] > 0.01)
93
+ & (df[self.economizer_sig_col] > 0.9)
94
+ )
95
+ )
96
+
97
+ # Rolling sum to count consecutive trues
98
+ rolling_sum = (
99
+ df["combined_check"].rolling(window=self.rolling_window_size).sum()
100
+ )
101
+ # Set flag to 1 if rolling sum equals the window size
102
+ df["fc15_flag"] = (rolling_sum >= self.rolling_window_size).astype(int)
103
+
104
+ if self.troubleshoot_mode:
105
+ print("Troubleshoot mode enabled - not removing helper columns")
106
+ sys.stdout.flush()
107
+ del df["htg_delta_temp"]
108
+ del df["htg_delta_sqrted"]
109
+ del df["combined_check"]
110
+
111
+ return df
112
+
113
+ except MissingColumnError as e:
114
+ print(f"Error: {e.message}")
115
+ sys.stdout.flush()
116
+ raise e # Re-raise the exception so it can be caught by pytest
@@ -0,0 +1,87 @@
1
+ import pandas as pd
2
+ import pandas.api.types as pdtypes
3
+ from open_fdd.air_handling_unit.faults.fault_condition import (
4
+ FaultCondition,
5
+ MissingColumnError,
6
+ )
7
+ import sys
8
+
9
+
10
+ class FaultConditionFive(FaultCondition):
11
+ """Class provides the definitions for Fault Condition 5.
12
+ SAT too low; should be higher than MAT in HTG MODE
13
+ --Broken heating valve or other mechanical issue
14
+ related to heat valve not working as designed
15
+ """
16
+
17
+ def __init__(self, dict_):
18
+ super().__init__()
19
+ self.mix_degf_err_thres = float
20
+ self.supply_degf_err_thres = float
21
+ self.delta_t_supply_fan = float
22
+ self.mat_col = str
23
+ self.sat_col = str
24
+ self.heating_sig_col = str
25
+ self.supply_vfd_speed_col = str
26
+ self.troubleshoot_mode = bool # default to False
27
+ self.rolling_window_size = int
28
+
29
+ self.set_attributes(dict_)
30
+
31
+ # Set required columns specific to this fault condition
32
+ self.required_columns = [
33
+ self.mat_col,
34
+ self.sat_col,
35
+ self.heating_sig_col,
36
+ self.supply_vfd_speed_col,
37
+ ]
38
+
39
+ def get_required_columns(self) -> str:
40
+ """Returns a string representation of the required columns."""
41
+ return f"Required columns for FaultConditionFive: {', '.join(self.required_columns)}"
42
+
43
+ def apply(self, df: pd.DataFrame) -> pd.DataFrame:
44
+ try:
45
+ # Ensure all required columns are present
46
+ self.check_required_columns(df)
47
+
48
+ if self.troubleshoot_mode:
49
+ self.troubleshoot_cols(df)
50
+
51
+ # Check analog outputs [data with units of %] are floats only
52
+ columns_to_check = [self.supply_vfd_speed_col, self.heating_sig_col]
53
+
54
+ for col in columns_to_check:
55
+ self.check_analog_pct(df, [col])
56
+
57
+ df["sat_check"] = df[self.sat_col] + self.supply_degf_err_thres
58
+ df["mat_check"] = (
59
+ df[self.mat_col] - self.mix_degf_err_thres + self.delta_t_supply_fan
60
+ )
61
+
62
+ df["combined_check"] = (
63
+ (df["sat_check"] <= df["mat_check"])
64
+ & (df[self.heating_sig_col] > 0.01)
65
+ & (df[self.supply_vfd_speed_col] > 0.01)
66
+ )
67
+
68
+ # Rolling sum to count consecutive trues
69
+ rolling_sum = (
70
+ df["combined_check"].rolling(window=self.rolling_window_size).sum()
71
+ )
72
+ # Set flag to 1 if rolling sum equals the window size
73
+ df["fc5_flag"] = (rolling_sum == self.rolling_window_size).astype(int)
74
+
75
+ if self.troubleshoot_mode:
76
+ print("Troubleshoot mode enabled - not removing helper columns")
77
+ sys.stdout.flush()
78
+ del df["mat_check"]
79
+ del df["sat_check"]
80
+ del df["combined_check"]
81
+
82
+ return df
83
+
84
+ except MissingColumnError as e:
85
+ print(f"Error: {e.message}")
86
+ sys.stdout.flush()
87
+ raise e # Re-raise the exception so it can be caught by pytest