Skip to content

Conversation

MSeifert04
Copy link
Contributor

@MSeifert04 MSeifert04 commented Apr 17, 2016

I've fixed some formatting issues, deleted some newlines in docstrings and included some points.

Closes #338

@crawfordsm crawfordsm added this to the 1.1 milestone Apr 18, 2016
@crawfordsm
Copy link
Member

@MSeifert04 can you submit with a commit without [skip ci]. It is a large amount of changes and it would be good that it doesn't effect anything.

@MSeifert04
Copy link
Contributor Author

MSeifert04 commented Apr 18, 2016

@crawfordsm For now this more or less a work-in-progress PR. I just check if there is missing punctuation, errors in the docstrings or some PEP8 warnings. I've submitted another commit (including some corrections in the combine.py) without the skip-ci.

@MSeifert04
Copy link
Contributor Author

That was more or less most of the really obvious (small) problems. There is still room for lots of clarification, additional links, removing links and cross-referencing of function/attributes. I think I'll leave it as is for now if nobody finds any mistakes I've made.

@MSeifert04
Copy link
Contributor Author

Sorry I've realized there was another problem in #338 regarding the bulleted list and some of the example codes did not have the right indentation.

@MSeifert04
Copy link
Contributor Author

I am very sorry for this flood of commits.

@MSeifert04
Copy link
Contributor Author

I will make another commit later to fix additional formatting issues (some of them just including optional and Default: ... to parameter descriptions. Especially for the very long docstrings this will be very handy but I've included it for all.

One (maybe objectionable) additional change: I'll omit the ~ for any numpy-related links, i.e. ~numpy.ndarray (rendered as ndarray)=> numpy.array (rendered as numpy.ndarray). I think this is an important change because ndarray is somewhat abstract (I always see it as array not as ndarray) but together with numpy it's less ambiguous.

@MSeifert04
Copy link
Contributor Author

So that's it. If there are no test failures I would appreciate if anyone wants to review this change. 😃

kwd['meta'] = kwd.pop('header', None)
if 'header' in kwd:
raise ValueError("Can't have both header and meta")
raise ValueError("Can't have both header and meta.")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since it's a nit picking PR, I would raise a super tiny point here. Start the error messages lowercase.

This was pointed out somewhere else recently (but now I can't find it), that if you look at what comes out of the interpreter, it may look more consistent to start the message lowercase as it follows a colon.
However this is something that's not done consistently yet in the astropy world, but would be nice to do.

In [1]: raise ValueError("Can't have both header and meta")
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-1-f52884564396> in <module>()
----> 1 raise ValueError("Can't have both header and meta")

ValueError: Can't have both header and meta

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a good point, I'll scan through the raise-items again.

How about log-infos? I think they are printed:

>>> nd2 = NDData(q, unit=u.cm)  
INFO: Overwriting Quantity's current unit with specified

So lowercase them too?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure, I think lowercase too.

minmax_clip : Boolean (default False)
Set to True if you want to mask all pixels that are below minmax_clip_min or above minmax_clip_max before combining.
minmax_clip : bool, optional (default False)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

again, move the default

@bsipocz
Copy link
Member

bsipocz commented Apr 18, 2016

@MSeifert04 - Left a few nitpicky comments, implement as few or many as you feel like.

img_list : `list`, 'string'
A list of fits filenames or CCDData objects that will be combined together.
Or a string of fits filenames seperated by comma ",".
img_list : list or string
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

str

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And I thought I got all of them. 😄

@MSeifert04
Copy link
Contributor Author

@bsipocz Thank you for all the comments. I've edited most of them except for numpy.ma.MaskedArray (I think).

@MSeifert04
Copy link
Contributor Author

The failing test is due to #343 and I've proposed a fix in #344. But I'm not sure if that fix is a smart move. There were no test failures but maybe conflicts with the intention of seperating header and meta from the other PR.

The actual data contained in this `~ccdproc.CCDData` object.
Note that this will always be copies by *reference* , so you should
make copy the ``data`` before passing it in if that's the desired
make copy the ``data`` before passing it in if that's the desired
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As long as we are cleaning up, could you please change make copy to make a copy?

@mwcraig
Copy link
Member

mwcraig commented Apr 26, 2016

@MSeifert04, thanks for the very thorough doc linting, and also thanks to @bsipocz for the extensive comments. This looks good to me @crawfordsm (there is one minor comment I made, but I'm ok with merging as-is if you want).

@MSeifert04
Copy link
Contributor Author

@mwcraig I've changed the sentence you mentioned. Actually I made some more changes in that sentence. If it's less understandable now I'll revert it again but copy by reference and make [a] copy the data sounded somehow wrong.

@MSeifert04
Copy link
Contributor Author

I think (hope) the installation problems with AppVeyor are not because of this PR.

@bsipocz
Copy link
Member

bsipocz commented Apr 26, 2016

@MSeifert04 - I've restarted appveyor. It's never the PRs fault if it's stuck at the point of installing miniconda ;)

@MSeifert04
Copy link
Contributor Author

Well I changed a line containing make copy so I wasn't sure 😄

@crawfordsm crawfordsm merged commit 07c2f39 into astropy:master May 3, 2016
@MSeifert04
Copy link
Contributor Author

@crawfordsm Thank you for merging. I hope the docs look better now (even if I doubt anyone will notice).

@MSeifert04 MSeifert04 deleted the core_docstrings branch May 3, 2016 19:43
@crawfordsm
Copy link
Member

Thanks for the PR and all the updates and fixes @MSeifert04 ! Very big help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Docstring formatting issue

4 participants