-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #57 from ModECI/development
Mainly contribs from Outreachy May-Aug 2023
- Loading branch information
Showing
49 changed files
with
2,461 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
import requests | ||
import pandas as pd | ||
import json | ||
import textwrap | ||
from datetime import date | ||
|
||
|
||
url = "https://api.github.com/repos/modeci/modelspec/contributors" | ||
|
||
response = requests.get(url=url, auth=("<github_username>", "<github_token>")) | ||
|
||
json_data = response.json() | ||
|
||
df = pd.DataFrame(json_data) | ||
|
||
per_info = list(df["url"].unique()) | ||
len_per_info = len(per_info) | ||
|
||
empty_list = [] | ||
for i in range(len_per_info): | ||
url = per_info[i] | ||
print(url) | ||
data = requests.get(url=url) | ||
requests_status = "unknown" | ||
while (requests_status == "unknown") or (requests_status == "unsuccessful"): | ||
if data.status_code == 200: | ||
requests_status = "successful" | ||
empty_list.append(data.json()) | ||
else: | ||
# handle failure on requests to the url for mac os | ||
requests_status = "unsuccessful" | ||
print(f"Failed to get data from: {url}") | ||
# make request again to get data from the url | ||
data = requests.get(url=url) | ||
|
||
df1 = pd.DataFrame(empty_list) | ||
df1["name"] = df1["name"].fillna("") | ||
name = df1["name"] | ||
login = df1["login"] | ||
url_html = df1["html_url"] | ||
url_id = df1["id"] | ||
|
||
login_html = list(zip(name, login, url_html)) | ||
zip_dict = dict(zip(url_id, login_html)) | ||
|
||
file = "sphinx/source/api/Contributors.md" | ||
with open(file, "w") as f: | ||
print( | ||
textwrap.dedent( | ||
"""\ | ||
(Modelspec:contributors)= | ||
# Modelspec contributors | ||
This page list names and Github profiles of contributors to Modelspec, listed in no particular order. | ||
This page is generated periodically, most recently on {}.""".format( | ||
date.today() | ||
) | ||
), | ||
file=f, | ||
) | ||
|
||
print("", file=f) | ||
|
||
for key, val in zip_dict.items(): | ||
print("- {} ([@{}]({}))".format(val[0], val[1], val[2]), file=f) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import shutil | ||
import os | ||
|
||
shutil.copy("../README.md", "sphinx/source/api/Introduction.md") | ||
|
||
for file_ in os.listdir("../examples"): | ||
if ("document" in file_) or ("README" in file_): | ||
shutil.copy( | ||
"../examples/%s" % file_, os.path.join("sphinx/source/api/examples", file_) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Minimal makefile for Sphinx documentation | ||
# | ||
|
||
# You can set these variables from the command line, and also | ||
# from the environment for the first two. | ||
SPHINXOPTS ?= | ||
SPHINXBUILD ?= sphinx-build | ||
SOURCEDIR = source | ||
BUILDDIR = build | ||
|
||
# Put it first so that "make" without argument is like "make help". | ||
help: | ||
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) | ||
|
||
.PHONY: help Makefile | ||
|
||
# Catch-all target: route all unknown targets to Sphinx using the new | ||
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). | ||
%: Makefile | ||
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
@ECHO OFF | ||
|
||
pushd %~dp0 | ||
|
||
REM Command file for Sphinx documentation | ||
|
||
if "%SPHINXBUILD%" == "" ( | ||
set SPHINXBUILD=sphinx-build | ||
) | ||
set SOURCEDIR=source | ||
set BUILDDIR=build | ||
|
||
%SPHINXBUILD% >NUL 2>NUL | ||
if errorlevel 9009 ( | ||
echo. | ||
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx | ||
echo.installed, then set the SPHINXBUILD environment variable to point | ||
echo.to the full path of the 'sphinx-build' executable. Alternatively you | ||
echo.may add the Sphinx directory to PATH. | ||
echo. | ||
echo.If you don't have Sphinx installed, grab it from | ||
echo.https://www.sphinx-doc.org/ | ||
exit /b 1 | ||
) | ||
|
||
if "%1" == "" goto help | ||
|
||
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% | ||
goto end | ||
|
||
:help | ||
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% | ||
|
||
:end | ||
popd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
/*Tweaks to the Pydata default CSS */ | ||
|
||
/*No yellow background highlight when targeted by summary tables */ | ||
/*dt:target { background-color: #f8f8f8; border: 1px solid black, }*/ | ||
dt:target { background: transparent;} | ||
/*More space between H1s and signatures in API reference*/ | ||
h1 { margin-bottom: 40px; } | ||
|
||
/*No line underneath summary table headings (clashes with line above first member)*/ | ||
p.rubric { border-bottom: 0px; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* Override nav bar color */ | ||
/*.wy-side-nav-search { | ||
background-color: #fbfbb6; | ||
} | ||
.wy-side-nav-search > a { | ||
color: #b2355c | ||
}*/ | ||
|
||
/* Override text bar color */ | ||
/*.caption-text { | ||
color: #b2355c; | ||
}*/ | ||
|
||
/* Override code signature colour */ | ||
/*.rst-content dl:not(.docutils) dt { | ||
background: #fbfbb6; | ||
color: #b2355c; | ||
border-top: solid 3px #b2355c; | ||
}*/ | ||
|
||
/* Override hyperlink colour */ | ||
/* a { | ||
color: #b2355c; | ||
}*/ | ||
|
||
/* Make content width wider*/ | ||
.wy-nav-content { | ||
max-width: 75% !important; | ||
} | ||
|
||
/* Word-wrap tables */ | ||
.wy-table-responsive table td, | ||
.wy-table-responsive table th { | ||
white-space: normal; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{{ fullname | escape | underline}} | ||
|
||
.. currentmodule:: {{ module }} | ||
|
||
.. autoclass:: {{ objname }} | ||
:members: | ||
:show-inheritance: | ||
:special-members: __call__, __add__, __mul__ | ||
|
||
{% block methods %} | ||
{% if methods %} | ||
.. rubric:: {{ _('Methods') }} | ||
|
||
.. autosummary:: | ||
{% for item in methods %} | ||
{%- if not item.startswith('_') %} | ||
{%- if item not in inherited_members %} | ||
~{{ name }}.{{ item }} | ||
{%- endif -%} | ||
{%- endif -%} | ||
{%- endfor %} | ||
{% endif %} | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
{{ fullname | escape | underline}} | ||
|
||
.. automodule:: {{ fullname }} | ||
|
||
{% block attributes %} | ||
{% if attributes %} | ||
.. rubric:: Module attributes | ||
|
||
.. autosummary:: | ||
:toctree: | ||
{% for item in attributes %} | ||
{{ item }} | ||
{%- endfor %} | ||
{% endif %} | ||
{% endblock %} | ||
|
||
{% block functions %} | ||
|
||
{% if functions %} | ||
.. rubric:: {{ _('Functions') }} | ||
|
||
.. autosummary:: | ||
:toctree: | ||
{% for item in functions %} | ||
{%- if not item.startswith('_') %} | ||
{{ item }} | ||
{% endif %} | ||
{%- endfor %} | ||
{% endif %} | ||
{% endblock %} | ||
|
||
{% block classes %} | ||
{% if classes %} | ||
.. rubric:: {{ _('Classes') }} | ||
|
||
.. autosummary:: | ||
:toctree: | ||
:template: custom-class-template.rst | ||
{% for item in classes %} | ||
{{ item }} | ||
{%- endfor %} | ||
{% endif %} | ||
{% endblock %} | ||
|
||
{% block exceptions %} | ||
{% if exceptions %} | ||
.. rubric:: {{ _('Exceptions') }} | ||
|
||
.. autosummary:: | ||
:toctree: | ||
{% for item in exceptions %} | ||
{{ item }} | ||
{%- endfor %} | ||
{% endif %} | ||
{% endblock %} | ||
|
||
{% block modules %} | ||
{% if modules %} | ||
.. autosummary:: | ||
:toctree: | ||
:template: custom-module-template.rst | ||
:recursive: | ||
{% for item in modules %} | ||
{{ item }} | ||
{%- endfor %} | ||
{% endif %} | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
(Modelspec:contributors)= | ||
|
||
# Modelspec contributors | ||
|
||
This page list names and Github profiles of contributors to Modelspec, listed in no particular order. | ||
This page is generated periodically, most recently on 2023-07-05. | ||
|
||
- Padraig Gleeson ([@pgleeson](https://github.com/pgleeson)) | ||
- David Turner ([@davidt0x](https://github.com/davidt0x)) | ||
- Parikshit Singh Rathore ([@parikshit14](https://github.com/parikshit14)) | ||
- Katherine Mantel ([@kmantel](https://github.com/kmantel)) |
Oops, something went wrong.