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

Add modeling parameter descriptions (#11230) #11232

Merged
merged 11 commits into from May 7, 2021
Merged

Conversation

Akshat1Nar
Copy link
Contributor

@Akshat1Nar Akshat1Nar commented Jan 11, 2021

Description

This pull request is to address ...

Fixes #11230

TODO

  • Get okay from maintainers to go forward.
  • Add change log under "new feature" under 4.3.
  • Add tests.
  • Add user facing documentation.

@Akshat1Nar
Copy link
Contributor Author

I have submitted this pull request just to get an idea. Basically what I fill be doing to fix this bug is going to every model and adding description="something" in every parameter of that model.

@pllim pllim changed the title Initial commit to bug#11230 Add modeling parameter descriptions (#11230) Jan 11, 2021
@pllim pllim marked this pull request as draft January 11, 2021 16:37
@pllim pllim requested a review from nden January 11, 2021 16:37
@pllim pllim added this to the v4.3 milestone Jan 11, 2021
@pllim
Copy link
Member

pllim commented Jan 11, 2021

Hello and thank you! This isn't really a bug, but more of implementing something new, so I adjusted the title, milestone, and so on. I also convert this to draft status for now. FYI.

@pllim pllim requested a review from hamogu January 11, 2021 16:40
@Akshat1Nar
Copy link
Contributor Author

Thankyou @pllim , should I continue to fill parameter description like this or wait for the review?

@pllim
Copy link
Member

pllim commented Jan 11, 2021

@Akshat1Nar , let's wait a bit so you don't waste your time if there is no buy-in. I added checkboxes above for clarity.

@hamogu
Copy link
Member

hamogu commented Jan 11, 2021

I think this looks good. I'm not a maintainer of this sub-package, but @nden has already agreed that this would be good to have in #11230 (comment). I think the level of detail it just right. Of course, for the Gaussian it's pretty easy (I mean, what else could a parameter that's called "amplitude" mean, if not the "Amplitude of the Gaussian"?). I think it's too early to pick on individual words, but I wonder if it would be more useful to explain "mean" as something like "position of the peak"? Saying "the parameter called mean is the mean" is true, but not terribly helpful.

So, I suggest that you go ahead and add descriptions for a few more models. I suggest that we look at it again when you have done may 10-12 models. That way, we have a little more to discuss, but we also make sure that we don't waste your time.

Thanks you so much for helping everyone making astropy better!

@Akshat1Nar
Copy link
Contributor Author

Thankyou @hamogu for that information. I will come back with more descriptions and then you can review again for mistakes. I have also updated first checkbox for now. :)

@Akshat1Nar
Copy link
Contributor Author

@pllim @hamogu Please review once you are available and help me in proceeding further. Thankyou.

Copy link
Member

@pllim pllim left a comment

Choose a reason for hiding this comment

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

Implementation-wise, it looks fine, but I am not the person to vet the actual verbiage used.

@Akshat1Nar
Copy link
Contributor Author

Implementation-wise, it looks fine, but I am not the person to vet the actual verbiage used.

Thankyou @pllim , I will wait for @hamogu 's review then :)

Copy link
Member

@hamogu hamogu left a comment

Choose a reason for hiding this comment

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

I left some suggestions. First, thanks for doing this. Please look at my suggestion and comments and see what you think. Please keep in mind that they are just that - suggestions that you can take or leave. You'll also see that in some cases my suggestions differ from what's in the docstring for that model. If you think your or my text for the parameter description is better than what's in there currently, feel free to improve the docstrings as well!
I know from personal experience that this part of the process can be very frustrating with you doing the work and me suggesting something else - and possible another reviewer coming in later who might have other ideas. Having these discussions over small details is how we try to make astropy perfect ;-)

astropy/modeling/functional_models.py Outdated Show resolved Hide resolved
y_mean = Parameter(default=0, description="Average value of random variable(along y axis) having this distribution(Gaussian)")
x_stddev = Parameter(default=1, description="Standard deviation of the Gaussian (along x axis)")
y_stddev = Parameter(default=1, description="Standard deviation of the Gaussian (along y axis)")
theta = Parameter(default=0.0, description="Rotation angle in radians (Optional parameter)")
Copy link
Member

Choose a reason for hiding this comment

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

Does it have to be in radians or does the unit framework allow specification in any angle unit?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is mentioned in documentation that angle is in radian.

Copy link
Contributor

Choose a reason for hiding this comment

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

If provided as quantity, it takes any angle unit as it should; maybe for brevity it can be put in parenthesis as suggested here. I have already updated the main docstring in #11177, but perhaps that could also be further clarified to something like

    theta : float or `~astropy.units.Quantity`, optional.
        Rotation angle (angular quantity or value in radians). The rotation angle increases

astropy/modeling/functional_models.py Outdated Show resolved Hide resolved
astropy/modeling/functional_models.py Outdated Show resolved Hide resolved
astropy/modeling/functional_models.py Outdated Show resolved Hide resolved
astropy/modeling/functional_models.py Outdated Show resolved Hide resolved
astropy/modeling/functional_models.py Outdated Show resolved Hide resolved
@@ -506,7 +506,7 @@ class Scale(Fittable1DModel):

"""

factor = Parameter(default=1)
factor = Parameter(default=1, description="Factor by which to scale a coordinate")
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
factor = Parameter(default=1, description="Factor by which to scale a coordinate")
factor = Parameter(default=1, description="Factor by which to scale a model")

astropy/modeling/functional_models.py Outdated Show resolved Hide resolved
astropy/modeling/functional_models.py Outdated Show resolved Hide resolved
@pep8speaks
Copy link

pep8speaks commented Jan 15, 2021

Hello @Akshat1Nar 👋! It looks like you've made some changes in your pull request, so I've checked the code again for style.

There are no PEP8 style issues with this pull request - thanks! 🎉

Comment last updated at 2021-05-06 15:53:46 UTC

@Akshat1Nar
Copy link
Contributor Author

@hamogu I took almost all of the suggestions, they all were necessary. And pushed the changes again. Please review and should I work on models in other files as well. This bug seems to be good-first-bug for me since I am getting to know the codebase as well. :)

@hamogu
Copy link
Member

hamogu commented Jan 15, 2021

Looks good. Do you want to continue?

@Akshat1Nar
Copy link
Contributor Author

Looks good. Do you want to continue?

Yes

@Akshat1Nar
Copy link
Contributor Author

@hamogu Please review, I think I have added description to most of them.

@Akshat1Nar
Copy link
Contributor Author

@hamogu Review ping.

@hamogu
Copy link
Member

hamogu commented Jan 21, 2021

@Akshat1Nar : Sorry, I have to finish something myself this week. This will have to wait till Friday afternoon or the weekend.

@Akshat1Nar
Copy link
Contributor Author

Thankyou for the response @hamogu :)

@pllim
Copy link
Member

pllim commented Jan 21, 2021

@Akshat1Nar , sometimes a reviewer needs a few weeks or even months to circle back. Unfortunately, that is the current reality of FOSS workflow. Thank you for your patience!

@hamogu
Copy link
Member

hamogu commented Jan 21, 2021

@Akshat1Nar But we should aim to keep it shorter. Months is far too long in my opinion. If it takes that long, please remind!

@Akshat1Nar
Copy link
Contributor Author

Ohh, thankyou for your advice guys, can you also shed some light how can I participate in gsoc or outreachy with Open Astronomy / Astropy . Any IRC channels I need to join any people I need to get familiar with, I am a person with time in hands, I would love to help out :) (@pllim @hamogu )

@pllim
Copy link
Member

pllim commented Jan 21, 2021

Re: OpenAstronomy GSOC participation -- There is a #gsoc channel on Astropy Slack. 😄

@Akshat1Nar
Copy link
Contributor Author

@pllim Thankyou, I will try to take any upcoming help on gsoc from there :)

@eteq
Copy link
Member

eteq commented May 3, 2021

Since this hasn't made the feature freeze cutoff I'm re-milestoning to 5.0

@eteq eteq modified the milestones: v4.3, v5.0 May 3, 2021
@hamogu
Copy link
Member

hamogu commented May 3, 2021

Uuups. I forgot about that.

@hamogu
Copy link
Member

hamogu commented May 3, 2021

Unfortunately, one change is that we''re now using town-crier instead of the Changelog file: https://docs.astropy.org/en/latest/development/workflow/development_workflow.html#add-a-changelog-entry

Since that's really me and @dhomeier that let it linger for so long, I can fix that up when everything else is done.

@hamogu
Copy link
Member

hamogu commented May 3, 2021

The other conflict is east, and I can also take care of that. What this means is, that there is no need to rebase right now, we can review and see if any more changes to the content are required and then re-base at the very end.

@Akshat1Nar
Copy link
Contributor Author

Hello @hamogu . What do I need to do to help to complete this pull request?

@dhomeier
Copy link
Contributor

dhomeier commented May 4, 2021

Must have missed the update from 1419388 here; apart from merging the test this looks good, but will probably need another review after rebasing, given the extensive documentation changes from #11118 and #11595.

@hamogu
Copy link
Member

hamogu commented May 4, 2021

@Akshat1Nar Do you want to try the doc changes or do you want me to do that? It's kind of a special situation of a PR that was opened before we switched to towncrier and so needs to be updated to that.

Instructions are here: #11279 (comment)
(except that "master" is now called "main", another one time change that just happens to fall on this).

If you want to do that, you are welcome to, if not, I'll do it in the next few days (adding on top of your commits so that you still get full credit for what you did)

@hamogu
Copy link
Member

hamogu commented May 6, 2021

OK, I changed to the CHANGES to the towncrier format and force-pushed that on top of @Akshat1Nar changes. Assuming that the CI still passes, I think this is ready for final review (which is why I added the "ready-for-final-review" label ;-)

@pllim
Copy link
Member

pllim commented May 6, 2021

@hamogu , does this mean the two reviews that requested changes can be dismissed? Thanks!

@hamogu
Copy link
Member

hamogu commented May 6, 2021

@dhomeier asked to review again after this, and I'll look through it, too. However, this is a case of "perfect is the enemy of good". The new description is better then what we had before (nothing), so cases where we've looked at that and decided that it's no ideal, but it mirrors the docstring should, in my opinion, not hold this up. Of course, I'd like to hear from @nden if we can.
(And I guess my review is now not good enough to merge any longer, because I'm one of the authors now ;-)

@hamogu
Copy link
Member

hamogu commented May 6, 2021

@dhomeier I believe that all the changes you requested were already done by @Akshat1Nar , but github did not update the display; not sure why. I've checked and manually marked them as resolved.

@dhomeier
Copy link
Contributor

dhomeier commented May 6, 2021

Thanks, yes I believe they had been marked resolved earlier this week, but maybe got lost again in the rebase.
Any syncing to descriptions from #11595 can be done in a follow-up.

@hamogu hamogu merged commit bb4c197 into astropy:main May 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Model parameter description does not exist
6 participants