-
Notifications
You must be signed in to change notification settings - Fork 0
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
Update examples #2
base: master
Are you sure you want to change the base?
Conversation
try: | ||
import matplotlib.pyplot as plt | ||
except ModuleNotFoundError: | ||
pass | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Myoldmopar, can you take a look here before I push it all the way through?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might consider storing a variable to indicate whether it has been properly imported or not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
try: | |
import matplotlib.pyplot as plt | |
except ModuleNotFoundError: | |
pass | |
try: | |
import matplotlib.pyplot as plt | |
plotting_enabled = True | |
except ModuleNotFoundError: | |
plotting_enabled = False | |
@vtnate here's where I'm at with this currently. @Myoldmopar how should we stage the changes here? There are a handful of changes we could make here.
Anything else? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Just a few comments, but ignore if you'd like.
try: | ||
import matplotlib.pyplot as plt | ||
except ModuleNotFoundError: | ||
pass | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might consider storing a variable to indicate whether it has been properly imported or not.
try: | ||
import matplotlib.pyplot as plt | ||
except ModuleNotFoundError: | ||
pass | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
try: | |
import matplotlib.pyplot as plt | |
except ModuleNotFoundError: | |
pass | |
try: | |
import matplotlib.pyplot as plt | |
plotting_enabled = True | |
except ModuleNotFoundError: | |
plotting_enabled = False | |
@@ -114,28 +117,28 @@ def main(): | |||
# Plot bore field thermal resistances | |||
# ------------------------------------------------------------------------- | |||
|
|||
# Configure figure and axes | |||
fig = gt.utilities._initialize_figure() | |||
if make_plots: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Definitely like this as an optional thing 👍
ax.set_title(f"Relative error relative to the 'similarities' solver " | ||
f"(Field of {N_1} by {N_2} boreholes)") | ||
# Adjust to plot window | ||
fig.tight_layout() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any chance to compile all the plotting into one place? Maybe a single file/class called plotting.py? There seems to be quite a bit of repetition, but each of these also seems a little different. So no biggie if not. Just a thought.
@@ -11,7 +14,7 @@ def main(): | |||
# ------------------------------------------------------------------------- | |||
|
|||
# Filepath to bore field text file | |||
filename = './data/custom_field_32_boreholes.txt' | |||
filename = Path(__file__).parent / "data", "custom_field_32_boreholes.txt" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
|
Thanks, @Myoldmopar !
|
I do agree. The only reason I mentioned it is so that people who currently pip install pygfunction will have zero loss of functionality, and we'll simply need to depend on pygfunction-core instead. |
Make sense. Thanks. |
@Myoldmopar is this python 3.8 failure worth fixing given that it is on the verge of obsolescence? |
Definitely not, time to pull that from the github workflow matrix. |
Cool. I'll remove it. |
Add `viz` install option
…to update_examples
No description provided.