Code Monkey home page Code Monkey logo

Comments (3)

JBGreisman avatar JBGreisman commented on June 12, 2024

This occurs because DataSet.stack_anomalous() removes the suffixes from anomalous columns during this method. It then eventually calls ds["I"], which would ordinarily return a DataSeries which has a from_friedel_dtype() method. However, since there are now two columns with the label "I", this call now returns a DataSet.

I'm considering this a bug, because it is certainly unexpected behavior. To resolve it, there are a few possible options in my mind:

  1. This behavior could be fixed by changing the column names later in the method. Although this would resolve this error, there would still be columns with the same name in the resulting DataSet. This will likely cause downstream problems.
  2. One could raise a ValueError when this case is detected. This can then give a more sensible error message like "This operation will result in two or more columns with the same name"
  3. We could do (2), but also add a only_keep_friedels=True flag that removes any non-Friedel columns with this operation. In the above example, this would drop the original "I" column, and output a DataSet with an "I" column generated from "I(+)" and "I(-)".

from reciprocalspaceship.

dennisbrookner avatar dennisbrookner commented on June 12, 2024

In the case of solution 2 (or perhaps 3 as well), I'd be happy to tackle this; it's similar to the change I made a little while back, and is still pretty fresh on my mind.

from reciprocalspaceship.

JBGreisman avatar JBGreisman commented on June 12, 2024

Awesome -- sounds good! Kevin's example will also make a good template for writing a test. Reach out if you run into trouble.

I'm inclined to suggest starting with (2), because (3) can currently be implemented by the user by dropping desired columns.

from reciprocalspaceship.

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.