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

Some floats in the csv file are processed as integers if they are whole numbers (like 1.0). #662

Open
Kenneth-T-Moore opened this issue Jan 30, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@Kenneth-T-Moore
Copy link
Member

Description

This is documented in utils/functions.py : convert_strings_to_data

    try:
        # if the value is a number store it as a float or an int as appropriate
        # BUG this returns floats that can be converted to int (e.g. 1.0) as an int (1), even if the variable requires floats
        value_list[ii] = int(float(dat)) if float(
            dat).is_integer() else float(dat)

Example

Setting Aircraft.Wing.AIRFOIL_TECHNOLOGY to 1.0 in a csv file will trigger this.

Aviary Version

0.9.9-dev

Relevant environment information

No response

@Kenneth-T-Moore Kenneth-T-Moore added the bug Something isn't working label Jan 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant