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

cleaning up measurestats with mesh iterator #208

Merged
merged 6 commits into from
Jul 11, 2016

Conversation

nickhand
Copy link
Member

  • this introduces a mesh iterator that can apply a function slab-by-slab, which should help the readability of the code

@nickhand
Copy link
Member Author

@rainwoodman -- take a look at the new project_to_basis(). I think this does a pretty good job hiding the details but leaving the general algorithm

@rainwoodman
Copy link
Member

Indeed. I am slightly in more favor of

for slab in SlabIterator(x3d, axes=0):
    xsq = slab.normp(p=2) # distance, length, ...
    # or insist on x = slab.norm(p=2)
    ....
    ....

this way we can avoid defining a temporary object and a temporary function.
The SlabIterator can be a generator function that yields Slab objects. p=2 is euclidean distance.

Yu

@rainwoodman
Copy link
Member

I do feels like the singular can go into the worker/iterator object too, by passing symmetric into the constructor.

@nickhand
Copy link
Member Author

that seems reasonable to me -- I think I could go either way. The temporary function is a bit ugly, but I did manage to hide the for loop though :)

@rainwoodman
Copy link
Member

Yes. but the cost is two temporary names. In addition,I have a rather strong opinion against 'worker's... I guess it is because the name is overly generic.

this was confusing, as shown by the fact that the old keyword actually was supposed
to mean the opposite of hermitian symmetric
… values

I have now confirmed we obtain the same power results, independent of the
choice of `axis` for the SlabIterator
@nickhand
Copy link
Member Author

Okay, I've got a new version of the SlabIterator running -- I've confirmed it works with generic axis values now. I've also changed the syntax regarding the "singular plane" in hopes of making it a bit more transparent. Let me know what you think.

I just went with a simple norm2 that returns the square of the norm on the slab, for the moment. I think that's the main use case at the moment. I'm happy for you to implement a more general p-norm (or any other small changes) after I merge.

@rainwoodman
Copy link
Member

It looks pretty cool indeed.

On Sun, Jul 10, 2016 at 3:31 PM, Nick Hand notifications@github.com wrote:

Okay, I've got a new version of the SlabIterator running -- I've confirmed
it works with generic axis values now. I've also changed the syntax
regarding the "singular plane" in hopes of making it a bit more
transparent. Let me know what you think.

I just went with a simple norm2 that returns the square of the norm on
the slab, for the moment. I think that's the main use case at the moment.
I'm happy for you to implement a more general p-norm (or any other small
changes) after I merge.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#208 (comment), or mute
the thread
https://github.com/notifications/unsubscribe/AAIbTIqzzrqvWVqoQIvFXVWRgTPIU6coks5qUXLGgaJpZM4JIvGG
.

@nickhand nickhand merged commit 86dc3c3 into bccp:master Jul 11, 2016
@nickhand nickhand deleted the clean_measurestats branch July 11, 2016 18:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants