Skip to content

Conversation

@JamesWrigley
Copy link
Contributor

Base already defines a IndexStyle(::AbstractArray) method for object arguments that uses the object type, so we can implement that directly and avoid the invalidations from implement Base.IndexStyle(::PyObjectArray). Fixes these invalidations:

 inserting IndexStyle(x::PythonCall.PyObjectArray) @ PythonCall.JlWrap ~/.julia/dev/PythonCall/src/JlWrap/objectarray.jl:13 invalidated:                                                                                                       
   backedges: 1: superseding IndexStyle(A::AbstractArray) @ Base indices.jl:94 with MethodInstance for IndexStyle(::AbstractArray) (132 children) 

Base already defines a IndexStyle(::AbstractArray) method for object arguments
that uses the object type, so we can implement that directly and avoid the
invalidations from implement Base.IndexStyle(::PyObjectArray).
The Dates stdlib already defines a method that does the same thing for any
`Period`.
@JamesWrigley
Copy link
Contributor Author

I took the liberty of removing some Dates.value() methods in 7766cc8 that seem unnecessary, on the Julia 1.12.2 backports branch that fixes these invalidations:

 inserting value(d::PythonCall.NumpyDates.TimeDelta64) @ PythonCall.NumpyDates /gpfs/exfel/data/scratch/wrigleyj/julia-depot/packages/PythonCall/MxsO4/src/NumpyDates/TimeDelta64.jl:26 invalidated:
   backedges: 1: superseding value(x::Dates.Period) @ Dates ~/src/julia/usr/share/julia/stdlib/v1.12/Dates/src/periods.jl:10 with MethodInstance for Dates.value(::Dates.Period) (285 children)

Bringing the total number of invalidations for v1 on the future 1.12.2 release down to 340 :)

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.

1 participant