Skip to content

pyimport can change set_zero_subnormals #629

Closed
@thchr

Description

@thchr

I'm not sure if this is only an issue with the Python package I'm loading, but it's annoying that it happens:

julia> get_zero_subnormals()
false

julia> using PythonCall

julia> mp = pyimport("meep")
Python: <module 'meep' from '/home/tchr/.julia/environments/v1.11/.CondaPkg/.pixi/envs/default/lib/python3.11/site-packages/meep/__init__.py'>

julia> get_zero_subnormals()
true

I got bit by that today, since it e.g. breaks parts of plotting in Makie (MakieOrg/Makie.jl#5122). Generally, having get_zero_subnormals() == true is not very nice since it breaks lots of things that make sense (e.g. -0.0 < 0.0 is then false).

Is it possible to guard against this on the PythonCall.jl side of things?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions