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

Change method for checking against provided country (get_currency) #93

Open
pythonreactor opened this issue Nov 10, 2022 · 1 comment
Open

Comments

@pythonreactor
Copy link

Problem

The current method for checking if a country exists in the given CSV file doesn't account for country names that do not have the full name as it has been set.

Example

TAIWANTAIWAN (PROVINCE OF CHINA)

Failure

>>> mpu.units.get_currency("TAIWAN")
>>> ValueError: Could not find currency 'TAIWAN'

Code Location

is_currency = currency_str in [row[0], row[1], row[2]]

@pythonreactor
Copy link
Author

#Proposed solution

...
is_currency = (
    True in [currency_str in r for r in row[:3]]
)
...

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

No branches or pull requests

1 participant