Closed j-c-cook closed 2 years ago
@MassimoCimmino
We could work around defining the thermal_resistances_dict
by accessing the object itself. It would require for thermal_resistances
to be passed self (technically this should be cls). However, there appears to be a decrease in performance. I have not investigated if this is due to the heavier weight of passing self, or that the hasattr
and getattr
functions are slower than accessing a dictionary. See https://github.com/MassimoCimmino/pygfunction/pull/185/commits/5009eb4ea84d16bcdbaaf21667e07343c7fb4816
HighLevel/find_near_square.py results
=====================================
* Single U-tube
---------------
Calculation time: 18.11 seconds
Height: 130.1818 meters
Number of boreholes: 156
Total Drilling: 20308.4 meters
* Double U-tube
---------------
Calculation time: 28.29 seconds
Height: 133.2133 meters
Number of boreholes: 144
Total Drilling: 19182.7 meters
* Coaxial tube
--------------
Calculation time: 18.25 seconds
Height: 132.7505 meters
Number of boreholes: 144
Total Drilling: 19116.1 meters
I am open to any ideas that would make this implementation cleaner.
Your timings suggests there is an issue with saving or accessing the previous outputs. Timings are similar to your results from here, before memoization.
I'd rather have the speed of your implementation. I am going to close this PR.
Massimo has done most of the work in #183 and #184. This is to try to help with finishing touches to get the changes implemented into the master branch.