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

Fix wavelength range print out to use regular nbsp #1466

Merged
merged 1 commit into from Dec 3, 2020

Conversation

mraspaud
Copy link
Member

@mraspaud mraspaud commented Dec 3, 2020

The International System of Units page on wikipedia says:

The value of a quantity is written as a number followed by a space (representing a multiplication sign) and a unit symbol; e.g., 2.21 kg, 7.3×102 m2, 22 K. This rule explicitly includes the percent sign (%)[28]:134 and the symbol for degrees Celsius (°C).[28]:133 Exceptions are the symbols for plane angular degrees, minutes, and seconds (°, ′, and ″, respectively), which are placed immediately after the number with no intervening space.

(https://en.wikipedia.org/wiki/International_System_of_Units#General_rules)

so a regular (not narrow) space is now used when displaying wavelength ranges.

@codecov
Copy link

codecov bot commented Dec 3, 2020

Codecov Report

Merging #1466 (029b5ee) into master (c0e21e6) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1466   +/-   ##
=======================================
  Coverage   90.58%   90.58%           
=======================================
  Files         239      239           
  Lines       34313    34313           
=======================================
  Hits        31081    31081           
  Misses       3232     3232           
Flag Coverage Δ
behaviourtests 4.53% <0.00%> (ø)
unittests 91.05% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
satpy/dataset/dataid.py 93.71% <100.00%> (ø)
satpy/tests/test_dataset.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c0e21e6...029b5ee. Read the comment docs.

@mraspaud mraspaud added this to In Progress in PCW Autumn 2020 via automation Dec 3, 2020
@djhoese
Copy link
Member

djhoese commented Dec 3, 2020

What does @gerritholl have to say about this? Wasn't there some ISO specification for non-breaking spaces and units?

Copy link
Member

@sfinkens sfinkens left a comment

Choose a reason for hiding this comment

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

LGTM, thanks a lot!

PCW Autumn 2020 automation moved this from In Progress to Approved Dec 3, 2020
@mraspaud
Copy link
Member Author

mraspaud commented Dec 3, 2020

@sfinkens did you get to test it in your sensitive terminal?

@sfinkens
Copy link
Member

sfinkens commented Dec 3, 2020

Yes it works fine!

@mraspaud mraspaud merged commit 744728f into pytroll:master Dec 3, 2020
PCW Autumn 2020 automation moved this from Approved to Done Dec 3, 2020
@mraspaud mraspaud deleted the fix-wavelength-repr branch December 3, 2020 16:13
@gerritholl
Copy link
Collaborator

gerritholl commented Dec 3, 2020

I thought this was in ISO 80000-1, but apparently not.

§7.1.4 states:

The symbol of the unit shall be placed after the numerical value in the expression for a quantity, leaving a space between the numerical value and the unit symbol. It should be noted that this rule also applies to the units per cent, %, and per mil, ‰. It should also be noted that, in accordance with this rule, the symbol ℃ for the degree Celsius shall be preceded by a space when expressing a Celsius temperature.

The only exceptions to this rule are for the units degree, minute and second for plane angle, in which case there shall be no space between the numerical value and the unit symbol.

Then there is §7.2.2 about compound units, which states that a compound unit may be written as "N · m", "N m", or "Nm". The latter alternative is not permitted if the first unit is either metre or Tesla as those can be confused with prefixes milli and tera, respectively.

The ISO standard doesn't specify what type of space shall be placed between the value and the symbol. Since we're only handling wavelengths here and not angles, the display was fine with ISO 80000-1 before this PR and remains fine with ISO 80000-1 after this PR.

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

Successfully merging this pull request may close these issues.

Encoding of wavelength range
4 participants