') + ')', 'gi'); if (regex.test(text)) { found = true; var frag = document.createDocumentFragment(); var parts = text.split(regex); parts.forEach(function(part, i) { if (i % 2 === 0) { frag.appendChild(document.createTextNode(part)); } else { var span = document.createElement('span'); span.className = 'userscript-highlight'; span.textContent = part; frag.appendChild(span); } }); node.parentNode.replaceChild(frag, node); } }); } else if (node.nodeType === 1 && node.childNodes) { // element var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT']; if (!skipTags.includes(node.tagName)) { Array.from(node.childNodes).forEach(highlight); } } } highlight(document.body); // Re-highlight on dynamic content var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1 || node.nodeType === 3) highlight(node); }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ', 'i'); if (__m === '*' || __re.test(location.href)) { // Strip utm_, fbclid, gclid, etc. from all links on page (function() { var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content', 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid', 'ref', 'ref_src', 'source', 'medium', 'campaign']; function cleanUrl(url) { try { var u = new URL(url, window.location.origin); var changed = false; trackingParams.forEach(function(p) { if (u.searchParams.has(p)) { u.searchParams.delete(p); changed = true; } }); return changed ? u.toString() : url; } catch (e) { return url; } } function cleanLinks() { document.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } cleanLinks(); var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1) { if (node.tagName === 'A') cleanLinks(); node.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + ', 'i'); if (__m === '*' || __re.test(location.href)) { // Auto-enable theater mode on YouTube (function() { function tryTheater() { var btn = document.querySelector('button[aria-label="Theater mode"], ytd-player #player button[title="Theater mode"]'); if (btn && !btn.classList.contains('activated')) { btn.click(); } } // Try immediately tryTheater(); // Try after navigation (SPA) var lastUrl = location.href; setInterval(function() { if (location.href !== lastUrl) { lastUrl = location.href; setTimeout(tryTheater, 500); } }, 1000); // Also try on player load var observer = new MutationObserver(tryTheater); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ', 'i'); if (__m === '*' || __re.test(location.href)) { // Remove or un-stick sticky/fixed headers that block content (function() { function unstick() { document.querySelectorAll('header, nav, [role="banner"], .header, .navbar, .sticky, .fixed-top, [style*="position: fixed"], [style*="position:sticky"]').forEach(function(el) { if (el.style.position === 'fixed' || el.style.position === 'sticky' || getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') { el.style.position = 'static'; el.style.top = 'auto'; el.style.zIndex = 'auto'; } }); } unstick(); var observer = new MutationObserver(unstick); observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] }); })(); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); })(); Add SPEC badge recommendation by jarrodmillman · Pull Request #305 · scientific-python/specs · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 74 additions & 0 deletions purpose-and-process/_index.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -163,6 +163,80 @@ Projects that adopt a SPEC early should engage in the collaborative
process leading to the SPEC being endorsed by the Core Projects, to
ensure that their use cases are incorporated.

#### Badges

Projects can highlight their adoption of specific SPECs with a SPEC badge.
For example, for SPEC 0, we recommend using

{{< tabs >}}

[[tab]]
name = 'Rendered badge'
content = '''
[![SPEC 0 — Minimum Supported Dependencies](https://img.shields.io/badge/SPEC-0-green?labelColor=%23004811&color=%235CA038)](https://scientific-python.org/specs/spec-0000/)
'''

[[tab]]
name = 'Markdown'
content = '''

```
[![SPEC 0 — Minimum Supported Dependencies](https://img.shields.io/badge/SPEC-0-green?labelColor=%23004811&color=%235CA038)](https://scientific-python.org/specs/spec-0000/)
```

'''

[[tab]]
name = 'reStructuredText'
content = '''

```
|SPEC 0 — Minimum Supported Dependencies|

.. |SPEC 0 — Minimum Supported Dependencies| image:: https://img.shields.io/badge/SPEC-0-green?labelColor=%23004811&color=%235CA038
:target: https://scientific-python.org/specs/spec-0000/
```

'''

{{< /tabs >}}

Alternatively, you can use one badge to indicate adoption of multiple SPECs.
For example, to indicate adoption of SPECs 0, 1, and 4, we recommend the following

{{< tabs >}}

[[tab]]
name = 'Rendered badge'
content = '''
[![Scientific Python Ecosystem Coordination](https://img.shields.io/badge/SPEC-0,1,4-green?labelColor=%23004811&color=%235CA038)](https://scientific-python.org/specs/)
'''

[[tab]]
name = 'Markdown'
content = '''

```
[![Scientific Python Ecosystem Coordination](https://img.shields.io/badge/SPEC-0,1,4-green?labelColor=%23004811&color=%235CA038)](https://scientific-python.org/specs/)
```

'''

[[tab]]
name = 'reStructuredText'
content = '''

```
|Scientific Python Ecosystem Coordination|

.. |Scientific Python Ecosystem Coordination| image:: https://img.shields.io/badge/SPEC-0,1,4-green?labelColor=%23004811&color=%235CA038
:target: https://scientific-python.org/specs/
```

'''

{{< /tabs >}}

### New SPEC Proposals

A good SPEC proposal focuses on a single key recommendation or idea
Expand Down
8 changes: 8 additions & 0 deletions quickstart.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -50,6 +50,14 @@
Briefly discuss what it means for a project to adopt this SPEC.
-->

#### Badges

Projects can highlight their adoption of this SPEC by including a SPEC badge.

{{{{< spec_badge number="{number}" title="{title}" >}}}}

To indicate adoption of multiple SPECS with one badge, see [this](../purpose-and-process/#badges).

## Implementation

<!--
Expand Down
6 changes: 6 additions & 0 deletions spec-0000/index.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -59,6 +59,12 @@ A core project endorsing this SPEC does **not** imply that that project will pro
Briefly discuss what it means for a project to adopt this SPEC.
-->

#### Badges

Projects can highlight their adoption of this SPEC by including a SPEC badge.
{{< spec_badge number="0" title="Minimum Supported Dependencies" >}}
To indicate adoption of multiple SPECS with one badge, see [this](../purpose-and-process/#badges).

## Implementation

### Motivation
Expand Down
9 changes: 6 additions & 3 deletions spec-0001/index.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -6,6 +6,7 @@ author:
- "Stéfan van der Walt <stefanv@berkeley.edu>"
- "Jon Crall <jon.crall@kitware.com>"
- "Dan Schult <dschult@colgate.edu>"
- "Jarrod Millman <millman@berkeley.edu>"
discussion: https://discuss.scientific-python.org/t/spec-1-lazy-loading-for-submodules/25
endorsed-by:
- ipython
Expand DownExpand Up@@ -66,9 +67,11 @@ subpackages lazily.
A prototype implementation of `lazy_loader` was adapted for
[napari](https://github.com/napari/napari/pull/2816).

<!--
Discuss what it means for a project to adopt this SPEC.
-->
#### Badges

Projects can highlight their adoption of this SPEC by including a SPEC badge.
{{< spec_badge number="1" title="Lazy Loading of Submodules and Functions" >}}
To indicate adoption of multiple SPECS with one badge, see [this](../purpose-and-process/#badges).

## Implementation

Expand Down
6 changes: 6 additions & 0 deletions spec-0002/index.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -32,6 +32,12 @@ Briefly discuss what it means for a core project to endorse this SPEC.
Briefly discuss what it means for a project to adopt this SPEC.
-->

#### Badges

Projects can highlight their adoption of this SPEC by including a SPEC badge.
{{< spec_badge number="2" title="API Dispatch" >}}
To indicate adoption of multiple SPECS with one badge, see [this](../purpose-and-process/#badges).

## Implementation

<!--
Expand Down
6 changes: 6 additions & 0 deletions spec-0003/index.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -32,6 +32,12 @@ Briefly discuss what it means for a core project to endorse this SPEC.
Briefly discuss what it means for a project to adopt this SPEC.
-->

#### Badges

Projects can highlight their adoption of this SPEC by including a SPEC badge.
{{< spec_badge number="3" title="Accessibility" >}}
To indicate adoption of multiple SPECS with one badge, see [this](../purpose-and-process/#badges).

## Implementation

### 1. Alt text
Expand Down
6 changes: 6 additions & 0 deletions spec-0004/index.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -52,6 +52,12 @@ Discuss what it means for a core project to endorse this SPEC.
Discuss what it means for a project to adopt this SPEC.
-->

#### Badges

Projects can highlight their adoption of this SPEC by including a SPEC badge.
{{< spec_badge number="4" title="Using and Creating Nightly Wheels" >}}
To indicate adoption of multiple SPECS with one badge, see [this](../purpose-and-process/#badges).

## Implementation

This section outlines how to implement using and building nightly wheels. We assume your
Expand Down
6 changes: 6 additions & 0 deletions spec-0005/index.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -31,6 +31,12 @@ Briefly discuss what it means for a core project to endorse this SPEC.
Briefly discuss what it means for a project to adopt this SPEC.
-->

#### Badges

Projects can highlight their adoption of this SPEC by including a SPEC badge.
{{< spec_badge number="5" title="CI Best Practices" >}}
To indicate adoption of multiple SPECS with one badge, see [this](../purpose-and-process/#badges).

## Implementation

<!--
Expand Down
30 changes: 18 additions & 12 deletions spec-0006/index.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -68,6 +68,24 @@ This document deals with the situation in which that is not possible, and secret

[^future-access]: Revoking access to a service implies both (a) revoking access to secrets and (b) re-generating those secrets, since the actor could have copied them.

### Core Project Endorsement

<!--
Discuss what it means for a core project to endorse this SPEC.
-->

### Ecosystem Adoption

<!--
Discuss what it means for a project to adopt this SPEC.
-->

#### Badges

Projects can highlight their adoption of this SPEC by including a SPEC badge.
{{< spec_badge number="6" title="Keys to the Castle" >}}
To indicate adoption of multiple SPECS with one badge, see [this](../purpose-and-process/#badges).

## Implementation

### Password storage: hosted
Expand DownExpand Up@@ -107,18 +125,6 @@ If a developer's access is removed, the vault is re-encrypted so that that devel
This ensures that they are of sufficient length and complexity.
- **SSH keys** must have a password. Ed25519 is the current recommended key type, and can be generated with `ssh-keygen -t ed25519`.

### Core Project Endorsement

<!--
Discuss what it means for a core project to endorse this SPEC.
-->

### Ecosystem Adoption

<!--
Discuss what it means for a project to adopt this SPEC.
-->

## Notes

See [gopass's security goals](https://github.com/gopasspw/gopass/blob/master/docs/security.md#security-goals).
Expand Down
30 changes: 18 additions & 12 deletions spec-0007/index.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -56,6 +56,24 @@ NumPy, SciPy, scikit-learn, scikit-image, and NetworkX all implement pseudo-rand
Common keyword arguments include `random_state` and `seed`.
In practice, the seed is also often controllable using `numpy.random.seed`.

### Core Project Endorsement

Endorsement of this SPEC means that a project considers the standardization and interpretation of the `rng` keyword, as well as avoiding use of global state and legacy bitstream generators, good ideas that are worth implemented widely.

### Ecosystem Adoption

To adopt this SPEC, a project should:

- deprecate the use of `random_state`/`seed` arguments in favor of an `rng` argument in all functions where users need to control pseudo-random number generation,
- use `numpy.random.default_rng` to validate the `rng` argument and instantiate a `Generator`, and
- deprecate the use of `numpy.random.seed` to control the random state.

#### Badges

Projects can highlight their adoption of this SPEC by including a SPEC badge.
{{< spec_badge number="7" title="Seeding pseudo-random number generation" >}}
To indicate adoption of multiple SPECS with one badge, see [this](../purpose-and-process/#badges).

## Implementation

Legacy behavior in packages such as scikit-learn (`sklearn.utils.check_random_state`) typically handle `None` (use the global seed state), an int (convert to `RandomState`), or `RandomState` object.
Expand DownExpand Up@@ -137,16 +155,4 @@ As an example, consider how a SciPy function would transition from a `random_sta

{{< include-code "transition_to_rng.py" "python" >}}

### Core Project Endorsement

Endorsement of this SPEC means that a project considers the standardization and interpretation of the `rng` keyword, as well as avoiding use of global state and legacy bitstream generators, good ideas that are worth implemented widely.

### Ecosystem Adoption

To adopt this SPEC, a project should:

- deprecate the use of `random_state`/`seed` arguments in favor of an `rng` argument in all functions where users need to control pseudo-random number generation,
- use `numpy.random.default_rng` to validate the `rng` argument and instantiate a `Generator`, and
- deprecate the use of `numpy.random.seed` to control the random state.

## Notes
7 changes: 7 additions & 0 deletions spec-0008/index.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,6 +8,7 @@ author:
- "Juanita Gomez <juanitagomezr2112@gmail.com>"
- "Seth Larson <sethmichaellarson@gmail.com>"
- "Lars Grüter <lagru@mailbox.org>"
- "Jarrod Millman <millman@berkeley.edu>"
discussion: https://discuss.scientific-python.org/t/spec-8-supply-chain-security
endorsed-by:
---
Expand All@@ -29,6 +30,12 @@ Securely _building_ release artifacts will be covered in a later SPEC. This set

While this SPEC is written with GitHub in mind, the same recommendations apply to other services, such as GitLab.

#### Badges

Projects can highlight their adoption of this SPEC by including a SPEC badge.
{{< spec_badge number="8" title="Securing the Release Process" >}}
To indicate adoption of multiple SPECS with one badge, see [this](../purpose-and-process/#badges).

## Implementation

With a focus on securing the release artifact distribution process, the following processes and standards should be adopted.
Expand Down
7 changes: 7 additions & 0 deletions spec-0009/index.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -7,6 +7,7 @@ author:
- "Inessa Pawson <inessapawson@gmail.com>"
- "Daniel McCloy <dan@mccloy.info>"
- "Matt Haberland <mhaberla@calpoly.edu>"
- "Jarrod Millman <millman@berkeley.edu>"
discussion: https://discuss.scientific-python.org/t/spec-9-governance/1229
is-draft: true
endorsed-by:
Expand DownExpand Up@@ -54,6 +55,12 @@ Briefly discuss what it means for a core project to endorse this SPEC.
Briefly discuss what it means for a project to adopt this SPEC.
-->

#### Badges

Projects can highlight their adoption of this SPEC by including a SPEC badge.
{{< spec_badge number="9" title="Governance" >}}
To indicate adoption of multiple SPECS with one badge, see [this](../purpose-and-process/#badges).

## Implementation

### Choosing a governance model
Expand Down