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

Fix numeric hf_y input as dtype object #90

Merged
merged 4 commits into from
Jun 29, 2022
Merged

Conversation

jonasvdd
Copy link
Member

@jonasvdd jonasvdd commented Jun 29, 2022

Should fix #89

TODO:

  • add a test

@codecov-commenter
Copy link

codecov-commenter commented Jun 29, 2022

Codecov Report

Merging #90 (3d8e3b5) into main (cc951c1) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main      #90   +/-   ##
=======================================
  Coverage   98.12%   98.12%           
=======================================
  Files          10       10           
  Lines         745      746    +1     
=======================================
+ Hits          731      732    +1     
  Misses         14       14           
Impacted Files Coverage Δ
...tly_resampler/aggregation/aggregation_interface.py 98.46% <ø> (-0.05%) ⬇️
...ler/figure_resampler/figure_resampler_interface.py 99.70% <100.00%> (+<0.01%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cc951c1...3d8e3b5. Read the comment docs.

@jonasvdd jonasvdd requested a review from jvdd June 29, 2022 09:29
@jonasvdd jonasvdd added the bug Something isn't working label Jun 29, 2022
@jvdd jvdd marked this pull request as ready for review June 29, 2022 09:57
@jvdd
Copy link
Member

jvdd commented Jun 29, 2022

Hmmm not really keen on this implementation. When you have data type object that contains bools it gets now converted to float as well (which is not in line with the plotly behavior).

fig = go.Figure()
fig.add_trace(
    go.Scattergl(
        y=np.array([True, False]*20).astype(object),
        mode="markers"
    )
)
# This shows true & false on the y-axis
fig = FigureWidgetResampler()
fig.add_trace(
    go.Scattergl(
        mode="markers"
    ),
    hf_y = np.array([True, False]*20).astype(object)
)
# This shows 0 & 1 on the y-axis

@jonasvdd
Copy link
Member Author

Maybe first try parsing to bool?

Copy link
Member

@jvdd jvdd left a comment

Choose a reason for hiding this comment

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

LGTM! Added some extra tests for binary data (to check if it does not get transformed to bool)

@jonasvdd jonasvdd merged commit 49317d3 into main Jun 29, 2022
@jvdd jvdd deleted the numeric_object_series branch July 3, 2022 13:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unexpected inverted y-axis from FigureResampler
3 participants