Skip to content
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

FEAT: Community package listing pages for astropy + SunPy #207

Merged
merged 4 commits into from
Nov 16, 2024
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
4 changes: 4 additions & 0 deletions _data/packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,9 @@
github_username: vn-ki
repository_link: https://github.com/sunpy/sunpy
version_submitted: 5.0.1
sunpy: true
communities:
- sunpy
categories:
- data-retrieval
- data-extraction
Expand Down Expand Up @@ -1098,6 +1101,7 @@
- data-munging
- reproducibility
- geospatial
joss: true
editor:
name: Alex Batisse
github_username: Batalex
Expand Down
79 changes: 31 additions & 48 deletions _includes/package-grid.html
Original file line number Diff line number Diff line change
@@ -1,82 +1,65 @@

<div class="element-item cards bubble {% for aCategory in apackage.categories %}
{{ aCategory }}
{% endfor %}" data-category="data">
<article
class="archive__item"
itemscope=""
itemtype="https://schema.org/CreativeWork"
>
<article class="archive__item" itemscope itemtype="https://schema.org/CreativeWork">
<h3 class="card__title no_toc" itemprop="headline">
{{ apackage.package_name }}
</h3>
<p class="page__meta contributors">
<span><i class="fas fa-feather" aria-hidden="true"></i>
{% if apackage.all_current_maintainers %}
{% for maintainer in apackage.all_current_maintainers %}
<a
href="https://github.com/{{ maintainer.github_username }}"
rel="maintainer"
target="_blank"
>
<a href="https://github.com/{{ maintainer.github_username }}" rel="maintainer" target="_blank">
{% if maintainer.name %}
{{ maintainer.name }}{% if forloop.last == false %},{% endif %}</a>
{{ maintainer.name }}{% if forloop.last == false %},{% endif %}
{% else %}
{{ maintainer.github_username }}{% if forloop.last == false %},{% endif %}</a>
{{ maintainer.github_username }}{% if forloop.last == false %},{% endif %}
{% endif %}
</a>
{% endfor %}
{% elsif apackage.submitting_author.name != 'Name' %}
<a
href="https://github.com/{{ apackage.submitting_author.github_username }}"
rel="maintainer"
target="_blank"
>
<a href="https://github.com/{{ apackage.submitting_author.github_username }}" rel="maintainer" target="_blank">
{{ apackage.submitting_author.name }}
</a>
{% else %}
<a
href="https://github.com/{{ apackage.submitting_author.github_username }}"
rel="maintainer"
target="_blank"
>
<a href="https://github.com/{{ apackage.submitting_author.github_username }}" rel="maintainer" target="_blank">
{{ apackage.submitting_author.github_username }}
</a>
{% endif %}
</span>
</span>
</p>
<span class="narrow">
<p class="archive__item-excerpt narrow" itemprop="description">
{{ apackage.package_description | markdownify }}
</p>
</span>
<ul>
<li>
<a href="{{ apackage.repository_link }}" rel="permalink">
<i class="fab fa-github"></i> View Code
</a>
</li>
<li><a href="{{ apackage.repository_link }}" rel="permalink"><i class="fab fa-github"></i> View Code</a></li>
{% if apackage.gh_meta.documentation %}
<li>
<a
href="{{ apackage.gh_meta.documentation }}"
rel="permalink"
>
<i class="fas fa-book-open"></i> View Docs
</a>
</li>
<li><a href="{{ apackage.gh_meta.documentation }}" rel="permalink"><i class="fas fa-book-open"></i> View Docs</a></li>
{% endif %}
{% if apackage.citation-link %}
<li>
<a href="{{ apackage.archive }}" rel="permalink">
<i class="fas fa-bookmark fa-fw"></i> Cite
</a>
</li>
<li><a href="{{ apackage.archive }}" rel="permalink"><i class="fas fa-bookmark fa-fw"></i> Cite</a></li>
{% endif %}
<li><a href="{{ apackage.issue_link }}"><i class="fa-solid fa-user-pen"></i> View Review</a></li>
{% if apackage.joss %}
<li><a href="{{ apackage.archive }}" rel="permalink"><i class="fas fa-bookmark fa-fw"></i> JOSS Approved</a></li>
{% endif %}
{% if apackage.astropy %}
<li><a href="partners/astropy.html"><i class="fa-solid fa-check-double"></i> <img src="http://img.shields.io/badge/Affiliated-Astropy-orange.svg?style=flat" alt="Astropy" /></a></li>
{% endif %}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we using partners or communities in this link?

{% if apackage.sunpy %}
<li><a href="partners/astropy.html"><i class="fa-solid fa-check-double"></i> <img src="http://img.shields.io/badge/Affiliated-Sunpy-yellow.svg?style=flat" alt="Astropy" /></a></li>
{% endif %}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same question here.

<li>
<a href= "{{ apackage.issue_link }}"> <i class="fa-solid fa-user-pen"></i> View Review </a>
</li>

</ul>

<hr>
{% if include.community %}
<h4>Package stats</h4>
<ul>
<li><strong>All Time Contributors:</strong> {{ apackage.gh_meta.contrib_count }}</li>
<li><strong>Last Commit date:</strong> {{ apackage.gh_meta.last_commit }}</li>
<li><strong>Date Created:</strong> {{ apackage.gh_meta.created_at }}</li>
</ul>
{% endif %}
</article>
</div>
</div>
11 changes: 11 additions & 0 deletions _pages/python-packages.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,22 @@ redirect_from:
{% assign packages_sorted = site.data.packages | sort_natural: 'date_accepted' | reverse %}
{% assign total_packages = packages_sorted | size %}


## Explore our accepted scientific Python open source packages

To date, {{ total_packages }} packages have been accepted into the pyOpenSci
ecosystem. [Click here to check out packages that are currently under review.](https://github.com/pyOpenSci/software-submission/issues)

### Community Partners

To view packages affiliated with our partner communities that are a part of ourpeer review partnership program, click on a community link below. [Learn more about our community partnerships here.](#)
lwasser marked this conversation as resolved.
Show resolved Hide resolved

<a href="/communities/astropy.html"><button class="button community">Astropy</button></a>

### All Packages - Search and filters

Below you can search and filter all of our packages.

<p><input type="text" id="quicksearch" placeholder="Search" /></p>

<div id="filters" class="button-group">
Expand Down
4 changes: 4 additions & 0 deletions _sass/minimal-mistakes/_pyos-isotope.scss
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ input[type="text"] {
text-shadow: 0 1px white;
cursor: pointer;
font-family: $body-font;

&.community {
background-color: rgb(193, 173, 219);
}
}

.button:hover {
Expand Down
150 changes: 77 additions & 73 deletions assets/js/dropdown.js
Original file line number Diff line number Diff line change
@@ -1,89 +1,93 @@
//Jquery to manage drop downs and accessibility
$(document).ready(function () {
$(".hamburger__btn-toggle").click(function (e) {
$(this).toggleClass("close");
// toggle expanded to try on click
$(this).attr('aria-expanded', function (i, attr) {
return attr == 'true' ? 'false' : 'true'});
// jQuery to manage drop downs and accessibility
$(document).ready(function() {
$(".hamburger__btn-toggle").click(function(e) {
$(this).toggleClass("close");
// Toggle expanded to try on click
$(this).attr('aria-expanded', function(i, attr) {
return attr == 'true' ? 'false' : 'true'
});

e.preventDefault();
$(".nav__links").toggleClass("vertical");
e.preventDefault();
$(".nav__links").toggleClass("vertical");
});

$(".dropdown").click(function (e) {
// close when user clicks nav
$(this).find(".dropdown-content").toggleClass("open");
// Handle making sure other drop menus are "closed" when another is open
$(this).siblings(".dropdown").find(".dropdown-content").removeClass("open");
$(this).siblings(".dropdown").find(".dropbtn").attr("aria-expanded", "false");
$(this).find(".dropbtn").attr('aria-expanded', function (i, attr) {
return attr == 'true' ? 'false' : 'true' });
$(".dropdown").click(function(e) {
// Close when user clicks nav
$(this).find(".dropdown-content").toggleClass("open");
// Handle making sure other drop menus are "closed" when another is open
$(this).siblings(".dropdown").find(".dropdown-content").removeClass("open");
$(this).siblings(".dropdown").find(".dropbtn").attr("aria-expanded", "false");
$(this).find(".dropbtn").attr('aria-expanded', function(i, attr) {
return attr == 'true' ? 'false' : 'true'
});
});

// Close dropdown when u click outside of the nav ul
$(document).click(function (e) {
if (!e.target.closest("ul") && $(".dropdown-content").hasClass("open")) {
$(".dropdown-content").removeClass("open");
}
// Close dropdown when you click outside of the nav ul
$(document).click(function(e) {
if (!e.target.closest("ul") && $(".dropdown-content").hasClass("open")) {
$(".dropdown-content").removeClass("open");
}
});
});


// isotope filtering
// This blog has a good example of smart resizing ... https://jewelfarazi.me/create-jquery-isotope-responsive-masonry-layout/
var qsRegex;
var buttonFilter;

// init Isotope
var $grid = $('.grid-isotope').imagesLoaded( function() {
$grid.isotope({
itemSelector: '.element-item',
layoutMode: 'masonry',
masonry: {
columnWidth: 100,
horizontalOrder: true,
},
filter: function() {
var $this = $(this);
var searchResult = qsRegex ? $this.text().match( qsRegex ) : true;
var buttonResult = buttonFilter ? $this.is( buttonFilter ) : true;
return searchResult && buttonResult;
}
});
});
// Isotope filtering
// This blog has a good example of smart resizing ... https://jewelfarazi.me/create-jquery-isotope-responsive-masonry-layout/
var qsRegex;
var buttonFilter;

$('#filters').on( 'click', 'button', function() {
buttonFilter = $( this ).attr('data-filter');
$grid.isotope();
});
// Init Isotope
var $grid = $('.grid-isotope').imagesLoaded(function() {
$grid.isotope({
itemSelector: '.element-item',
layoutMode: 'masonry',
masonry: {
columnWidth: 100,
horizontalOrder: true,
},
filter: function() {
var $this = $(this);
var searchResult = qsRegex ? $this.text().match(qsRegex) : true;
var buttonResult = buttonFilter ? $this.is(buttonFilter) : true;
return searchResult && buttonResult;
}
});
});

// use value of search field to filter
var $quicksearch = $('#quicksearch').keyup( debounce( function() {
qsRegex = new RegExp( $quicksearch.val(), 'gi' );
$grid.isotope();
}) );
// Filter on button click
$('#filters').on('click', 'button', function() {
buttonFilter = $(this).attr('data-filter');
$grid.isotope();
});

// Use value of search field to filter
var $quicksearch = $('#quicksearch').keyup(debounce(function() {
qsRegex = new RegExp($quicksearch.val(), 'gi');
$grid.isotope();
}));

// change is-checked class on buttons
$('.button-group').each( function( i, buttonGroup ) {
var $buttonGroup = $( buttonGroup );
$buttonGroup.on( 'click', 'button', function() {
$buttonGroup.find('.is-checked').removeClass('is-checked');
$( this ).addClass('is-checked');
// Change is-checked class on buttons
$('.button-group').each(function(i, buttonGroup) {
var $buttonGroup = $(buttonGroup);
$buttonGroup.on('click', 'button', function() {
$buttonGroup.find('.is-checked').removeClass('is-checked');
$(this).addClass('is-checked');
});
});
});

// debounce so filtering doesn't happen every millisecond
function debounce( fn, threshold ) {
var timeout;
threshold = threshold || 100;
return function debounced() {
clearTimeout( timeout );
var args = arguments;
var _this = this;
function delayed() {
fn.apply( _this, args );
}
timeout = setTimeout( delayed, threshold );
};
}
// Debounce so filtering doesn't happen every millisecond
function debounce(fn, threshold) {
var timeout;
threshold = threshold || 100;
return function debounced() {
clearTimeout(timeout);
var args = arguments;
var _this = this;

function delayed() {
fn.apply(_this, args);
}
timeout = setTimeout(delayed, threshold);
};
}
64 changes: 64 additions & 0 deletions communities/astropy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
---
layout: splash
title: "Astropy"
excerpt: "An ecosystem of interoperable astronomy packages."
header:
overlay_color: "rgb(255, 80, 0)"
overlay_filter: 0.6
overlay_image: images/communities/astropy-banner.png
image_alt: "Digital elevation model"
permalink: communities/astropy.html
intro:
- excerpt: "Astropy is a pyOpenSci community peer review partner. [Learn more about our peer review partnership program](/partners.html)."
classes: wide
community: astropy
---

{%
assign pkgs = site.data.packages
| where_exp: "item", "item.partners contains page.community" | sort_natural: 'date_accepted' | reverse
%}

{% assign total_packages = pkgs | size %}

{% include feature_row id="intro" type="center" %}

## pyOpenSci peer review partner: {{ page.community | capitalize }}

## About Astropy

[Astropy](https://www.astropy.org/) is a community effort to develop a common
core package for Astronomy in Python. Astropy also fosters an ecosystem of
interoperable astronomy packages. Please remember to acknowledge and cite the use of any {{ page.community }}
packages that you use.

Astropy currently has {{ total_packages }} packages that have been accepted by pyOpenSci and also become affiliated Astropy packages through our [partnership](partners.html).


<p><input type="text" id="quicksearch" placeholder="Search {{ page.community }} packages" /></p>


<div id="filters" class="button-group">
<button class="button is-checked" data-filter="*">show all</button>
<button class="button" data-filter=".data-munging, .data-processing-munging">data munging</button>
<button class="button" data-filter=".data-extraction">data extraction</button>
<button class="button" data-filter=".data-retrieval">data retrieval</button>
<button class="button" data-filter=".data-visualization">data-visualization</button>
<button class="button" data-filter=".education">education</button>

<button class="button" data-filter=".geospatial">geospatial</button>
<button class="button" data-filter=".reproducibility">reproducibility</button>
</div>



<div class="grid-isotope">
{% for apackage in pkgs %}
{% include package-grid.html community=page.community %}
{% endfor %}
</div>

<!-- ## TODO's

Do we want to somehow connect with the metrics
[scientific python is collecting via devstats](https://devstats.scientific-python.org/_generated/astropy.html)? -->
Binary file added images/communities/astropy-banner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading