by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Francesco Bonazzi
    @Upabjojr
    or maybe...
    maybe it's better to start writing the code
    we can comment on the code later
    Faisal Riyaz
    @friyaz
    Yes, that will be good
    I will need a bit more time on this one maybe
    Francesco Bonazzi
    @Upabjojr
    sure
    you can also start sharing your drafts
    I mean... you can open a PR even if the code isn't finished yet
    Faisal Riyaz
    @friyaz
    Yes, sure.
    Also, I looked at the functools.singledispatch. I do not think we can use it there in convenient manner.
    Can you clarify little about how that should be used?
    Francesco Bonazzi
    @Upabjojr
    @singledispatch
    def your_method():
        pass
    
    @your_method.register(A):
    def _(...):
        ... code block <A> ...
    
    @your_method.register(B):
    def _(...):
        ... code block <B> ...
    instead of:
    class A:
        ...
        def your_method(self, ...):
            ... code block <A> ...
    
    class B:
        ...
        def your_method(self, ...):
            ... code block <B> ...
    with singledispatch, you are defining a method outside of a class
    Faisal Riyaz
    @friyaz
    This is not working for me if I use it in another module. Maybe I am doing something wrong. I will try fixing it
    Francesco Bonazzi
    @Upabjojr

    Instead of calling

    a = A()
    b = B()
    
    a.your_method( )
    b.your_method(  )

    you call

    your_method(a)
    your_method(b)
    it should be able to understand which method to call

    This is not working for me if I use it in another module. Maybe I am doing something wrong. I will try fixing it

    how are you doing it?

    Faisal Riyaz
    @friyaz
    I am getting an error for _
    I guess I am importing incorrectly
    from orignalmodule import class.functionname
    Francesco Bonazzi
    @Upabjojr
    what do you mean?
    from sympy.geometry import Class1, Class2
    Faisal Riyaz
    @friyaz
    Thanks, I will fix it.
    Francesco Bonazzi
    @Upabjojr

    from orignalmodule import class.functionname

    I don't understand this syntax :(

    Faisal Riyaz
    @friyaz
    from sympy.geometry import Class1.functionname, Class2.functionname
    Sorry
    Francesco Bonazzi
    @Upabjojr
    can you do that?
    I don't think you can use "." after import
    it's the first time I see that
    Faisal Riyaz
    @friyaz
    No, it was the problem.
    :)
    Francesco Bonazzi
    @Upabjojr
    the functionname should be defined in sympy.vector
    not in sympy.geometry
    Faisal Riyaz
    @friyaz
    Thanks, It is working now. I was trying to dispatch a class method.
    outside the class in a different module
    Francesco Bonazzi
    @Upabjojr
    we haven't used singledispatch very much, because we were supporting Python 2.7 and 3.4 until last yera
    now that we dropped support of Python 2.7, we should start using it a bit more
    Faisal Riyaz
    @friyaz
    Yes, I was surprised that Python added the support for function overloading this late
    I was also considering adding a simple way to create a vector. See Oscar's comment on sympy/sympy#17978
    The current notation for using base scalars and vectors can sometimes be irritating.
    Faisal Riyaz
    @friyaz
    sympy/sympy#19681 : Attempt to convert implicitly defined conics to ParametricRegion
    One of the steps is to determine the (d − 1)-fold point P of Curve C.
    I have net yet found any algorthim for this.
    Faisal Riyaz
    @friyaz

    One of the steps is to determine the (d − 1)-fold point P of Curve C.

    This is essentially finding a singular point of multiplicity d - 1.
    A point where there are d - 1 distinct tangents to curve?

    Francesco Bonazzi
    @Upabjojr
    have you tried to implement that algorithm?
    Faisal Riyaz
    @friyaz

    have you tried to implement that algorithm?

    sympy/sympy#19681: parameterization of conics

    For parameterizing monoids, I am still stuck at finding the singular point of d - 1 multiplicity?
    Any pointers on how to proceed with this?
    Faisal Riyaz
    @friyaz

    After some searches, I found:

    A singular point (xo,y o) of C a is said to be of multiplicity m if all the partial derivatives off to order m - 1 vanish there