Skip to content

plotdata.py: updated limiting of string values#205

Open
Marvin-HH wants to merge 1 commit into
ebranlard:mainfrom
Marvin-HH:patch-1
Open

plotdata.py: updated limiting of string values#205
Marvin-HH wants to merge 1 commit into
ebranlard:mainfrom
Marvin-HH:patch-1

Conversation

@Marvin-HH

Copy link
Copy Markdown

Hi,
I had a case were I plotted a log file which contained some sensors with text data (in my case controller state). In my case the original limitation prevented me from plotting. Therefore, I changed the limitation to 100 unique strings instead of 1000 strings in total.

Probably others would like to have this change included as well.

PS: Feel free to set the level to any number you see reasonable.

Change limitation on strings from 1000 strings in total to 100 unique strings. This allows plotting of data sets with text data (e.g. log files)
@ebranlard

Copy link
Copy Markdown
Owner

Hi,

Thanks for doing a pull request. The changes looks reasonable, but it's definitely good to have a limit because plotting a lot of strings gets fairly messy and slow. In my experience, it usually indicates that a datatype was poorly read in which case we should try to change the reader to make sure numbers are not read as string. But if that's not the case here and you are indeed plotting strings, I'm happy to increase the limit. Are you sure you intend to plot strings?

Before changing the limit, we might need to change the logic a bit so that n is still the length of PD.y (stored later in _n0), something like:

if y is string:
     nu = len(PD.y.unique())
     if nu > 1000:
          raise Exception

Keep me in touch

@Marvin-HH

Copy link
Copy Markdown
Author

Hi,
thanks for your quick response. Yes, I definitely have strings. But the amount of turbine stages is limited. So plotting still makes sense.
Regarding the code. For sure, changing the logic makes absolutely sense. I did not went through the rest of the code if my change impacts other parts. Thanks for your correction.

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.

2 participants