colour-science / colour

Colour Science for Python
https://www.colour-science.org
BSD 3-Clause "New" or "Revised" License
2.13k stars 263 forks source link

PR: Use `shape` if passed, to also reshape the `colour.continuous.AbstractContinuousSignal` sub-classes in `colour.colorimetry.sd_to_XYZ_integration` definition. #1250

Closed KelSolaar closed 8 months ago

KelSolaar commented 8 months ago

Summary

This PR ensures that the shape argument, if passed, is also used to reshape the colour.continuous.AbstractContinuousSignal sub-classes in colour.colorimetry.sd_to_XYZ_integration definition.

References #1247.

Preflight

Code Style and Quality

Documentation

KelSolaar commented 8 months ago

Something is broken, I will take a look tonight!

tjdcs commented 8 months ago

@KelSolaar While you are looking at this can you also check that the ArrayLike inputs actually get converted to an array before the caching check in sd_to_XYZ? I noticed that if you pass in a list[float] the method fails. I think it just needs an asarray somewhere before calling tobytes() (when xxhash is installed)

KelSolaar commented 8 months ago

Should be done!

coveralls commented 8 months ago

Coverage Status

coverage: 99.721% (-0.002%) from 99.723% when pulling f832096fd37aeaf88e129dfed4aec106c34cc5c8 on sd_to_xyz_integration_shape into 7fb9fccd020255604d059d05c287974a05f9c888 on develop.

KelSolaar commented 8 months ago

Going to merge this one @tjdcs!