-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create API for computing g-function values from static inputs #308
Conversation
Moving the interface from A proper TLDR; Create My two cents. Massimo supersedes. |
I like the idea of a simplified API but I think it would be more beneficial for all to create your own wrapper package with pygfunction dependency than patching pygfunction and increase maintenance load this end as @j-c-cook said. Simplified access to pygfunction could help some especially those who don't need or want GHEDesigner. |
The intent is to create the a very simple interface for passing in a set of descriptive static parameters, and returning g-function values. This is a minimal addition that will provide easier access with near zero maintenance. |
Thank you @mitchute for the PR and thank you @j-c-cook and @ikijano for the input. I agree having a more streamlined way of generating g-functions is a positive addition to the project. If I can summarize the PR, it is proposed to add a bore field class that (i) checks and formats geometrical parameters of the bore field and (ii) provides a class method to calculate the g-function. In addition, the bore field class can be initialized by lists of geometrical parameters. Do we need a separate I would see basic usage as:
Some points for discussion:
Let me know your thoughts. This could provide the basic interface before later working on the integration of the bore field class into the other modules (in #210). |
@MassimoCimmino Considering the order of modules listed in
Here's my response to your points:
|
@MassimoCimmino thanks for supporting this effort. Your summary of the PR is accurate. Also, thank you for pointing out issue #210. I think this aligns well with that. I'll try to respond to your points below.
field_1 = BoreField()
field_1.init_l_shaped(L_shaped_args...)
field_1.generate_g_functions(args...)
field_2 = BoreField()
field_2.init_u_shaped(U_shaped_args...)
field_2.generate_g_functions(args...)
|
I quickly drafted an implementation on my branch : https://github.com/MassimoCimmino/pygfunction/tree/api
from gt.borefield import BoreField
# A list of boreholes is the default initialization argument
field_1 = BoreField(list_of_boreholes)
gfunc_1 = field_1.evaluate_g_function(field, alpha, time)
# Class methods build the list of boreholes internally to create the object
field_2 = BoreField.from_lists(H, D, r_b, x, y)
gfunc_2 = field_2.evaluate_g_function(field, alpha, time) We can definitely add the field arrangements to the gfunc = field.evaluate_g_function(field, alpha, time).gFunc |
@MassimoCimmino thank for this. This all sounds fine. How do you want to proceed here? Should we pull your changes into our branch, or do you just want to go ahead with yours? |
@mitchute I thinkk I can push directly to your branch if that is fine with you. I will tidy up the implementation and come back to you for a final look before merging. I may change it so that the default |
@MassimoCimmino that works for me, thanks! |
Copying my comment from mitchute#4: A little summary of my implementation if you want to discuss any of the changes:
Something to consider is if the The PR is much larger than I expected. I will review it and make sure it is compatible with the planned changes for issue #210. |
Either way seems OK for now, but the latter option may be better. I believe we have some changes drafted proposing to move |
In that case I will place it at the top of the file and we can iterate in a separate thread. |
Merged. Thanks to all who contributed. |
This PR creates some structures to simplify using
pygfunction
as a g-function calculator. The API proposed collects the necessary data into a class, and provides a few methods and the necessary structure to enable passing static borehole field parameters as inputs, and returning the g-function values.