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

Shelter radiation_porosity bug when values are mixed floats/ints #200

Closed
jamesramsden-bh opened this issue Jun 4, 2024 · 0 comments · Fixed by #203
Closed

Shelter radiation_porosity bug when values are mixed floats/ints #200

jamesramsden-bh opened this issue Jun 4, 2024 · 0 comments · Fixed by #203
Assignees
Labels
type:bug Error or unexpected behaviour

Comments

@jamesramsden-bh
Copy link
Contributor

jamesramsden-bh commented Jun 4, 2024

To replicate, create a typology where the radiation_porosity type in the first shelter does not match the type of any of the other shelters, e.g.

Typology(
        identifier=f"Test Typology",
        shelters=[
            Shelter.from_adjacent_wall(angle=0, radiation_porosity = (0,) * 8760),
            Shelter.from_adjacent_wall(angle=90, radiation_porosity = (0.0,) * 8760),
        ],
        )

Then run an ExternalComfort with this typology as an input to a SimulationResult. The ExternalComfort will fail. This is because the numpy stuff under the hood can't handle these mixed types. (Specifically, it fails on line 859 of _shelterbase, because numpy gets the object type from the first shelter on line 855.)

Easiest fix: when constructing the shelter, force convert the radiation_porosity to float, or enforce float type in the post init.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Error or unexpected behaviour
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants