Skip to content

Quantulum incorrect for prefixes that are not capitilized if the unit is incorrectly capitilized #161

@hwalinga

Description

@hwalinga

Describe the bug
When a unit is incorrectly capitilized, the SI-prefix will be read wrong.

To Reproduce

from quantulum3 import parser

parser.parse('1mw')  # returns: Megawatt
parser.parse('1pw')  # returns: Petawatt

parser.parse('1Pw')  # returns: Picowatt

Expected behavior

from quantulum3 import parser

parser.parse('1mw')  # should be: Milliwatt
parser.parse('1pw')  # should be: Picowatt

parser.parse('1Pw)'  # should be: Petawatt

Note
pW and PW, mW and MW are correctly read.

Additional information:

  • Python Version: [3.7, 3.8]
  • Classifier activated/ sklearn installed: yes (pw will not be read if not installed)
  • OS: MX Linux 19 (Debian 10 derivative)
  • Version: 0.7.5

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions