Skip to content
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

allow plot_G_Avgs.py to parse files with variable number of iterations #383

Merged
merged 1 commit into from
Sep 14, 2022

Conversation

tukss
Copy link
Contributor

@tukss tukss commented Sep 13, 2022

This resizes the array on the fly to support G_Avg files with a variable number of iterations per files.

fixes #375

@tukss tukss requested a review from hirokemono September 13, 2022 21:07
@hirokemono
Copy link

It still fails after reading the send file because arrays seem s to be expanded by using nsize from the first data file.

a.niter would be used to expand array size in lines 112 to 116 instead of nsize.

    gavgs = numpy.resize(gavgs, (gavgs.shape[0] + a.niter, gavgs.shape[1]))
    iters = numpy.resize(iters, iters.shape[0] + a.niter)
    time = numpy.resize(time, time.shape[0] + a.niter)

i1 = i0 + a.niter

@tukss tukss force-pushed the fix_g_avgs_variable_niter branch from 7c1caa3 to bd3a146 Compare September 14, 2022 01:40
@tukss
Copy link
Contributor Author

tukss commented Sep 14, 2022

The new commit actually updates niter. Thanks for finding it @hirokemono.

Copy link

@hirokemono hirokemono left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It works! thanks!

@hirokemono hirokemono merged commit bf59808 into geodynamics:master Sep 14, 2022
@tukss tukss deleted the fix_g_avgs_variable_niter branch September 14, 2022 03:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reading Failure a series of global average data files with different sizes (self.niter)
2 participants