Code Monkey home page Code Monkey logo

Comments (5)

minhuanli avatar minhuanli commented on June 12, 2024

Hey Jack, I am wondering what is the current situation of the issue (Maybe this is not an issue anymore)?
If I have one-column anomalous data (similar to that after calling stack_anomalous), is there anything wrong if I call to_reciprocal_grid?

from reciprocalspaceship.

minhuanli avatar minhuanli commented on June 12, 2024

If I understand correctly, say I have a stacked one-column anomalous data, the only difference would be I have to skip the line p1 = p1.expand_anomalous() in to_reciprocal_grid function?

from reciprocalspaceship.

JBGreisman avatar JBGreisman commented on June 12, 2024

Yes -- this is currently unsupported because of the line you mentioned. If one-column anomalous data is provided, it should be sufficient to just skip the call the p1.expand_anomalous(), but I haven't actually tested that.

For 2-column anomalous data, a few more changes will be needed because a call to stack_anomalous() will be needed. We would also need to make some API decisions about how the two columns are specified (e.g. tuple of column labels)

from reciprocalspaceship.

minhuanli avatar minhuanli commented on June 12, 2024

Yes, that makes sense.

How about taking another argument like anomalous=False? And when set to True, whether to callstack_anomalous or skip that line can be determined by the number of columns in the key?

I am happy to create a PR for this if you think above is a good way.

from reciprocalspaceship.

JBGreisman avatar JBGreisman commented on June 12, 2024

I think we can make the interface work intuitively without the need for anomalous=[True|False]. I think the following should work, but let me know if you think I'm missing something:

  • If key is a single string, we check whether all HKLs are in the + ASU. If they are, we call p1.expand_anomalous(). If the HKLs are in +/- ASU we skip the call to p1.expand_anomalous(). This should support non-anomalous data, or single-column anomalous.
  • If the key is a pair of strings, we assume that we are operating in two-column anomalous mode. We call stack_anomalous(), and then treat it as one-column anomalous data as above.

Implicitly, there are two checks that will automatically happen:

  1. stack_anomalous() will confirm that the two columns have the same dtype for us when operating in two-column mode.
  2. expand_to_p1() will ensure that we are operating on a merged DataSet. This function only makes sense for merged data with unique Miller indices, because otherwise the order of the data will matter (the last entry for each Miller index will overwrite the preceding entries in the reciprocal grid).

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.