Repository navigation
Conversation
filename and os were undefined, and fileout was replaced by the input extension plus .bts.
T was used before assignment, so it returned nan.
n was undefined.
AMR-Wind writes plane points with axis1 fastest, but read() reshaped them as if z were. Place each point by its coordinates, take dt from the file when timestep is not given, and let hubValues compute uRef.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Small fixes, one commit each.
AMRWindFile.readused an undefinedfilenameandoswas not imported, so AMRWindFile andTurbSimFile.fromAMRWindalways raised NameError. fromAMRWind also ignoredfileoutand wrote to.nc.bts(the input extension plus .bts).With that fixed, the reader still put values at the wrong coordinates. AMR-Wind writes plane points with axis1 varying fastest (
PlaneSampler::sampling_locations), but read() reshaped them as if z did, so with the usual axis1 along y the y and z data were swapped. fromAMRWind swapped them back, which only worked for square planes and crashed otherwise (could not broadcast input array from shape (5,3,5) into shape (5,5,3)for a 5x3 plane). read() now places each point by its coordinates, so any plane shape and axis order works, and a rotated plane gives a clear ValueError.timestepis optional now (dt comes from thetimevariable in the file), and fromAMRWind lets hubValues compute uRef like the other converters, so y=0 and zref no longer have to be grid points.equivalent_loadreturned nan for datetime64 time becauseTwas used before assignment. The corner case test expected that nan; it now checks that datetime64 gives the same result as the same span in seconds.fast_input_fileraised NameError instead of EmptyFileError for an empty file, andpdf_histogram(count=True)used an undefinedn; it now divides by the number of samples in the histogram.Tested with synthetic AMR-Wind files written in PlaneSampler order: y-z planes of 7x4, 4x7 (axis1 along z), 5x5 and 6x3 with three x offsets, and a horizontal plane all read back exactly, and the .bts written by fromAMRWind round trips. The test suite has the same 11 failures as main (pandas 3, which #90 fixes).