Skip to content

Fixes #327, 0 min temp causes no temp value available - #331

Open
Zehen-249 wants to merge 1 commit into
Aditya-Donde:devfrom
Zehen-249:dev
Open

Fixes #327, 0 min temp causes no temp value available#331
Zehen-249 wants to merge 1 commit into
Aditya-Donde:devfrom
Zehen-249:dev

Conversation

@Zehen-249

@Zehen-249 Zehen-249 commented Aug 1, 2026

Copy link
Copy Markdown
Collaborator

Fixes #327

def _compute_temperature_values(self, working_input_dict: dict) -> dict:  # compute: derives effective bridge temperature range and rise/fall from IRC 6 thermal inputs
        from osdagbridge.core.utils.codes.irc6_2017 import IRC6_2017

        max_str = working_input_dict.get(KEY_TL_HIGHEST_MAX_TEMP)
        min_str = working_input_dict.get(KEY_TL_LOWEST_MIN_TEMP)
        if not max_str or not min_str or max_str == "—" or min_str == "—":
              print("Value None")
              print(f"Max: {max_str}, Min: {min_str}")
              return {}

        try:
            max_temp = float(max_str)
            min_temp = float(min_str)
        except ValueError:
            return {}

the conditional if not max_str or not min_str or max_str == "—" or min_str == "—": causes the issue.
in python 0 is considered false hence all locations with min temp 0 falls under this conditional.

resolution instead of checking if not max_str chack if max_str is None

@Zehen-249
Zehen-249 requested a review from mhsuhail00 August 1, 2026 08:39
@Zehen-249 Zehen-249 changed the title Fix Issue #327, 0 min temp causes no temp value available Fixes #327, 0 min temp causes no temp value available Aug 1, 2026
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.

Project location values are not populated in the Temperature Load additional inputs for Jabalpur, Madhya Pradesh

1 participant