Git Product home page Git Product logo

Comments (6)

cjachekang avatar cjachekang commented on May 13, 2024

Is an error message like this better? I just raised a syntax error since this behaves like a syntax error.

image

from lux.

dorisjlee avatar dorisjlee commented on May 13, 2024

Yeah, the SyntaxError seems appropriate here. I wonder if we could just map this into a VisList internally and still return something, but place a warning.

from lux.

cjachekang avatar cjachekang commented on May 13, 2024

image

I've been trying it out and my approach is to construct a VisList if the intent list length is greater than 1 and display that inside of Vis's repr_html - but, it seems to be a bit buggy cause we are trying to have two files import each other. I think we can do it if we turn VisList into something importable (i.e just doing import VisList or something like that) -> I dont know if having two files import each other is good practice though. Alternatively, we can merge Vis and VisList together so that we can construct a VisList inside the Vis and just display the VisList and throw the error after.

from lux.

dorisjlee avatar dorisjlee commented on May 13, 2024

You're right, it's probably not a good idea to have the two packages import each other. I recall this is one of the reasons why I separated them out in the first place. Let's opt for just showing the error message then, but making it a bit interpretable, something along the lines of:

The intent corresponds to more than one visualizations, please replace the Vis constructor with VisList to generate a list of visualizations. For more information, see: https://lux-api.readthedocs.io/en/latest/source/guide/vis.html#working-with-collections-of-visualization-with-vislist

from lux.

dorisjlee avatar dorisjlee commented on May 13, 2024

Resolved in #135

from lux.

dorisjlee avatar dorisjlee commented on May 13, 2024

The multi-vis error is not being thrown in this case, leading to other downstream errors that is harder for the user to parse.

df = pd.read_csv('https://github.com/lux-org/lux-datasets/blob/master/data/olympic.csv?raw=true')
df["Year"] = pd.to_datetime(df["Year"], format='%Y') # change pandas dtype for the column "Year" to datatype

from lux.vis.Vis import Vis
intent = ["Season=Winter|Summer","AthleteRegion"]
vis = Vis(intent,df)
vis

The check inside check_not_vislist_intent does not check for "|" or list notation.
We should extend the check to cover all scenarios where a VisList could be generated as well in the tests.

from lux.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.