Implemented preferred rescaling by rgerkin · Pull Request #173 · python-quantities/python-quantities · GitHub
Skip to content

Implemented preferred rescaling - #173

Merged
apdavison merged 2 commits into
python-quantities:masterfrom
scidash:master
Feb 13, 2020
Merged

apdavison merged 2 commits into
python-quantities:masterfrom
scidash:master

Conversation

@rgerkin

@rgerkin rgerkin commented Jan 28, 2020

Copy link
Copy Markdown
Contributor

See #172.

@apdavison

Copy link
Copy Markdown
Contributor

@rgerkin

rgerkin commented Jan 28, 2020

Copy link
Copy Markdown
Contributor Author

Yes, I will do all those things. Sorry about the versioneer thing. There was a period several months ago when it was not working, but it's been resolved so I will rebase and remove that commit.

@rgerkin

rgerkin commented Jan 28, 2020

Copy link
Copy Markdown
Contributor Author

I've simplified the PR as requested, and added unit tests. But I'm unclear as to where the usage examples would go, or if they should go anywhere at all.

As for the string comparison, I could probably replace that with a direct comparison of the simplified units, but I am always hesitant to trust __eq__ based on previous experiences. But if you think that is better I'll make the change.

@rgerkin

rgerkin commented Feb 12, 2020

Copy link
Copy Markdown
Contributor Author

@apdavison Any thoughts?

@apdavison

apdavison commented Feb 13, 2020 •

Copy link
Copy Markdown
Contributor

Hi @rgerkin, this looks good. The documentation is auto-generated, so the best place for the usage examples would be in docstrings. Please could you add a docstring for rescale_preferred and extend the docstring for rescale to explain what happens if units is None?

(actual usage examples aren't really needed, just docstrings that explain the behaviour).

@rgerkin

rgerkin commented Feb 13, 2020

Copy link
Copy Markdown
Contributor Author

@apdavison
apdavison merged commit 72cdf4e into python-quantities:master Feb 13, 2020
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