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

np.genfromtxt #34

Merged
merged 1 commit into from
Jan 25, 2021
Merged

np.genfromtxt #34

merged 1 commit into from
Jan 25, 2021

Conversation

davidstandingford
Copy link
Contributor

Added a dtype for the string turbine name, with a check on the length of the actual name.

Added a dtype for the string turbine name, with a check on the length of the actual name.
# catch the case where only one turbine location is specified
if (location_array.ndim < 1):
location_array = np.reshape(location_array, (1,))
for location in location_array:
idx += 1
name = location[0]
name = str(location[0])
if len(name) > 99: print('WARNING: farm.py: turbine name may be truncated '+str(name))
Copy link
Contributor

Choose a reason for hiding this comment

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

This check will never actually hit because we've already done the truncation as we've passed through np.genfromtxt with the format to limit to 100 characters.
Without manually parsing the file and extracting the name to check this I can't see how we can apply this warning usefully here.

@jsharpe jsharpe merged commit 1169638 into turbine Jan 25, 2021
@jsharpe jsharpe deleted the davidstandingford-patch-1 branch January 25, 2021 11:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants