Skip to content

export SUnitRange #474

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

export SUnitRange #474

wants to merge 1 commit into from

Conversation

schmrlng
Copy link
Contributor

I feel like SUnitRange is useful enough (especially for slicing other StaticArrays) to merit exporting.

@andyferris
Copy link
Member

Yes, this isn't unreasonable... :)

There has been a long-standing plan to support static ranges, LinearIndices and CartesianIndices with StaticArrays. These things would be returned by axes and indices. I've been waiting for v1.0 for that to happen (because compatibility is hard enough between v0.6 users and v1.0 users already) so it might be time to have a rethink of this soon.

@schmrlng
Copy link
Contributor Author

Sure, if it's a question of API stability/not committing to this exact form for fewer "breaking" changes once more general ranges are worked out I'm happy to keep manually importing this secret functionality.

@andyferris
Copy link
Member

OK thanks. Please bump this again soon-ish if I don't get to this.

@c42f c42f added feature features and feature requests design speculative design related issue labels Aug 1, 2019
@c42f c42f mentioned this pull request Aug 1, 2019
18 tasks
@c42f c42f added this to the 1.0 milestone Sep 28, 2019
@tpapp
Copy link
Contributor

tpapp commented Nov 2, 2019

This PR addresses #620. It would be nice to have a docstring though, perhaps with an example in use, and the docs should also mention this.

@tpapp
Copy link
Contributor

tpapp commented Feb 9, 2020

Friendly bump --- could this be merged please?

bors bot added a commit to CliMA/ClimateMachine.jl that referenced this pull request Sep 10, 2020
1537: Use static range in Grad setproperty! r=mwarusz a=mwarusz

# Description

After #1458 I noticed a slowdown. This PR proposes a fix.
Running ```julia --project=. experiments/AtmosLES/bomex_les.jl --monitor-timestep-duration 100steps``` I get
Before:
```
┌ Info: Wall-clock time per time-step (statistics across MPI ranks)
│    maximum (s) =    1.5273617989999998e-02
│    minimum (s) =    1.5273617989999998e-02
│    median  (s) =    1.5273617989999998e-02
└    std     (s) =                       NaN
```
After:
```
 Info: Wall-clock time per time-step (statistics across MPI ranks)
│    maximum (s) =    1.1554147779999999e-02
│    minimum (s) =    1.1554147779999999e-02
│    median  (s) =    1.1554147779999999e-02
└    std     (s) =                       NaN
```

The fix relies on unexported `StaticArrays` API but JuliaArrays/StaticArrays.jl#474 makes me think that this is ok.




1538: Rename step (intrinsic func) r=charleskawczynski a=charleskawczynski

# Description

Closes #95.



Co-authored-by: Maciej Waruszewski <[email protected]>
Co-authored-by: Charles Kawczynski <[email protected]>
bors bot added a commit to CliMA/ClimateMachine.jl that referenced this pull request Sep 10, 2020
1537: Use static range in Grad setproperty! r=mwarusz a=mwarusz

# Description

After #1458 I noticed a slowdown. This PR proposes a fix.
Running ```julia --project=. experiments/AtmosLES/bomex_les.jl --monitor-timestep-duration 100steps``` I get
Before:
```
┌ Info: Wall-clock time per time-step (statistics across MPI ranks)
│    maximum (s) =    1.5273617989999998e-02
│    minimum (s) =    1.5273617989999998e-02
│    median  (s) =    1.5273617989999998e-02
└    std     (s) =                       NaN
```
After:
```
 Info: Wall-clock time per time-step (statistics across MPI ranks)
│    maximum (s) =    1.1554147779999999e-02
│    minimum (s) =    1.1554147779999999e-02
│    median  (s) =    1.1554147779999999e-02
└    std     (s) =                       NaN
```

The fix relies on unexported `StaticArrays` API but JuliaArrays/StaticArrays.jl#474 makes me think that this is ok.




Co-authored-by: Maciej Waruszewski <[email protected]>
@c42f c42f removed this from the 1.0 milestone Nov 23, 2020
@hyrodium
Copy link
Collaborator

What's the status of this PR? Is this just waiting for resolving the conflicts?

@tpapp
Copy link
Contributor

tpapp commented Dec 6, 2023

Friendly ping; please reconsider this PR. If anything else needs to be done I am willing to do it or make another PR if that is preferred.

@hyrodium
Copy link
Collaborator

hyrodium commented Dec 7, 2023

I think the only problem with SUnitRange is #978. It would be better to have SUnitRange <: AbstractUnitRange, but changing the supertype may be a breaking change because the type is widely used, I guess.

Considering SUnitRange as a stable API is not a bad practice, so exporting it would be okay for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
design speculative design related issue feature features and feature requests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants