Repository navigation
Improvements to NDData class - #348
Conversation
|
I've now added some basic 'getting started' documentation for the new functionality |
There was a problem hiding this comment.
I would bring this in line with your return statements and call it result_data instead of final_data
There was a problem hiding this comment.
Ok, I've fixed this. I've renamed final_data to result, and the return value to result_error. I'm using result to refer to the NDData object rather than result_data because the latter could be confused with result.data
There was a problem hiding this comment.
Actually, scrub that, I now pass only the data array, so this is indeed now result_data
|
This code is a great implementation of the decisions made yesterday during the telecon and should be merged so the NDData children classes have a common API to build from. |
There was a problem hiding this comment.
why the change to single-triple quotes for docstrings? PEP 257, blah blah blah....
There was a problem hiding this comment.
Ah, I wasn't aware of PEP 257. I've changed the docstring quotes back to triple double quotes :-)
|
Nice job @astrofrog -- this looks great! |
|
I've tweaked the implementation of the error propagation very slightly. Before, methods such as which seems strange because it could have just set the error in-place. The reason which is more consistent and elegant in my view. |
|
I've added detection of correlated errors as discussed on the mailing list. Here's an example in action: https://gist.github.com/3413356 As part of this, I added a mechanism to disable error propagation ( Docs and tests are still needed for this. EDIT: this has since been removed for now |
|
@eteq - could you review this once you get a chance? (no rush though). |
|
@astrofrog - will do in a day or two |
…ddition and subtraction of datasets.
…ved addition and subtraction of NDData objects
|
I have rebased, and removed the code to detect correlated errors, replacing it instead with warnings in the documentation about correlated errors not being supported. |
|
This is now ready for a final review. |
There was a problem hiding this comment.
this sould be warning, not warn - right now it (ironically) gives a sphinx warning that it doesn't recognize the directive.
There was a problem hiding this comment.
Here and in the subtraction one, perhaps you should say Whether to propagate errors following the propagation rules defined by error`` or something like that. Just reading this blindly, I think "how does it know how to propagate errors?"
|
One general comment on the documentation: Right now it's a bit confusing, because all of the information is in "getting started", and there's not really anything about the maining Other than that and my inline comments above, looks great to me! |
|
Now that the 'getting stated' section has grown, I agree we should move some of it to the main docs section. I'll work on that this week. |
There was a problem hiding this comment.
I admit this is a confusing mix of two meanings of the word "Error", but shouldn't this be IncompatibleErrorsError? Or maybe IncompatibleErrorsException if you don't like the double-error?
… in error class, expanded NDData docs
|
@eteq - I've tried addressing all the comments you raised. A couple of points - regarding your suggestion of: I changed Regarding: the line: is actually incorrect - is also not quite right. I've significantly re-arranged the docs and added a section about sub-classing that discusses all this. Could you take a look over it now? Regarding sub-classing errors, I think we may decide to change the API slightly when we actually end up implementing another error class, so we shouldn't consider it set in stone. |
|
@astrofrog - Re the name changes: my concern over The rest looks great, though! |
There was a problem hiding this comment.
When I build the docs, it gives me a warning here because it thinks :doc: is an option string - the easiest solution is to just move the "see" part to the second line (before :doc:)
|
I think I've addressed all your comments. Regarding I think that the NDError API could definitely be improved in future - for example, one could imagine that in some cases how the data is combined will depend on the error propagation, so maybe the NDError sub-classes should actually do the data arithmetic too (e.g. if the data represents the mean of a PDF, then when two PDFs are combined the data may change non-trivially). In that case, we just need to pass Anything else that needs to be addressed before merging? |
|
Merge ahoy! |
|
Sorry to leave you hanging here - I'm happy with this as-is, and as far as I can tell everyone else is, so I'll go ahead and merge it right now! |
Improvements to nddata subpackage/NDData class
Improvements to nddata subpackage/NDData class
Add fallback for when stdout locale isn't defined
…atus Updating astroML dev status
Following the telecon on the NDData class (minutes here) I have implemented the changes we decided on. With apologies to @wkerzendorf, I had to implement the
StandardDeviationErrorto ensure that things worked properly, since there is a tight coupling betweenNDErrorandNDData.To demonstrate the current behavior, I posted the transcript of a session to Gist: https://gist.github.com/3378408
Please have a look over this, and feel free to suggest any improvements within the scope of the telecon decisions (no unrelated new features). Also, please try out this implementation and see if you can break it or see unexpected behavior.
Once we're all happy with the coding and functionality, I will update the documentation and will add some more tests.