Skip to content

Commit d4bbe40

Browse files
authored
Merge pull request #58 from ModECI/test_xml3
To v0.3.2; tidy up of contributors generation
2 parents d3aa38b + d82c106 commit d4bbe40

File tree

6 files changed

+49
-37
lines changed

6 files changed

+49
-37
lines changed

.github/workflows/ci.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ jobs:
1212
name: Format
1313
runs-on: ubuntu-latest
1414
steps:
15-
- uses: actions/checkout@v1
16-
- uses: actions/setup-python@v2
17-
- uses: pre-commit/action@v2.0.0
15+
- uses: actions/checkout@v3
16+
- uses: actions/setup-python@v3
17+
- uses: pre-commit/action@v3.0.0
1818
with:
1919
extra_args: --hook-stage manual --all-files
2020

@@ -28,9 +28,9 @@ jobs:
2828
runs-on: [ubuntu-latest, macos-latest, windows-latest]
2929

3030
steps:
31-
- uses: actions/checkout@v2
31+
- uses: actions/checkout@v3
3232
- name: Set up Python ${{ matrix.python-version }}
33-
uses: actions/setup-python@v2
33+
uses: actions/setup-python@v3
3434
with:
3535
python-version: ${{ matrix.python-version }}
3636

@@ -89,8 +89,9 @@ jobs:
8989
python arrays.py -run # test one example
9090
9191
- name: Build Documentation
92+
if: ${{ matrix.python-version != '3.7'}}
9293
run: |
93-
94+
# Note: contributors generation below fails on py 3.7 due to pandas version...
9495
pip install .[docs]
9596
cd docs
9697
python generate.py

docs/contributors.py

Lines changed: 33 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -17,50 +17,57 @@
1717
len_per_info = len(per_info)
1818

1919
empty_list = []
20+
max_tries = 100
21+
2022
for i in range(len_per_info):
2123
url = per_info[i]
2224
print(url)
2325
data = requests.get(url=url)
2426
requests_status = "unknown"
25-
while (requests_status == "unknown") or (requests_status == "unsuccessful"):
27+
while max_tries > 0 and (
28+
(requests_status == "unknown") or (requests_status == "unsuccessful")
29+
):
2630
if data.status_code == 200:
2731
requests_status = "successful"
32+
print(" Received: %s" % data.json())
2833
empty_list.append(data.json())
2934
else:
3035
# handle failure on requests to the url for mac os
3136
requests_status = "unsuccessful"
3237
print(f"Failed to get data from: {url}")
3338
# make request again to get data from the url
3439
data = requests.get(url=url)
40+
max_tries -= 1
3541

36-
df1 = pd.DataFrame(empty_list)
37-
df1["name"] = df1["name"].fillna("")
38-
name = df1["name"]
39-
login = df1["login"]
40-
url_html = df1["html_url"]
41-
url_id = df1["id"]
42+
if len(empty_list) > 0:
43+
df1 = pd.DataFrame(empty_list)
44+
df1["name"] = df1["name"].fillna(df1["login"])
45+
name = df1["name"]
46+
login = df1["login"]
47+
url_html = df1["html_url"]
48+
url_id = df1["id"]
4249

43-
login_html = list(zip(name, login, url_html))
44-
zip_dict = dict(zip(url_id, login_html))
50+
login_html = list(zip(name, login, url_html))
51+
zip_dict = dict(zip(url_id, login_html))
4552

46-
file = "sphinx/source/api/Contributors.md"
47-
with open(file, "w") as f:
48-
print(
49-
textwrap.dedent(
50-
"""\
51-
(Modelspec:contributors)=
53+
file = "sphinx/source/api/Contributors.md"
54+
with open(file, "w") as f:
55+
print(
56+
textwrap.dedent(
57+
"""\
58+
(Modelspec:contributors)=
5259
53-
# Modelspec contributors
60+
# Modelspec contributors
5461
55-
This page list names and Github profiles of contributors to Modelspec, listed in no particular order.
56-
This page is generated periodically, most recently on {}.""".format(
57-
date.today()
58-
)
59-
),
60-
file=f,
61-
)
62+
This page list names and Github profiles of contributors to Modelspec, listed in no particular order.
63+
This page is generated periodically, most recently on {}.""".format(
64+
date.today()
65+
)
66+
),
67+
file=f,
68+
)
6269

63-
print("", file=f)
70+
print("", file=f)
6471

65-
for key, val in zip_dict.items():
66-
print("- {} ([@{}]({}))".format(val[0], val[1], val[2]), file=f)
72+
for key, val in zip_dict.items():
73+
print("- {} ([@{}]({}))".format(val[0], val[1], val[2]), file=f)

docs/sphinx/source/api/Contributors.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,12 @@
33
# Modelspec contributors
44

55
This page list names and Github profiles of contributors to Modelspec, listed in no particular order.
6-
This page is generated periodically, most recently on 2023-07-05.
6+
This page is generated periodically, most recently on 2023-08-23.
77

88
- Padraig Gleeson ([@pgleeson](https://github.com/pgleeson))
9+
- Manifest Chakalov ([@mqnifestkelvin](https://github.com/mqnifestkelvin))
910
- David Turner ([@davidt0x](https://github.com/davidt0x))
11+
- Peace Ododo ([@Onoyiza](https://github.com/Onoyiza))
1012
- Parikshit Singh Rathore ([@parikshit14](https://github.com/parikshit14))
11-
- Katherine Mantel ([@kmantel](https://github.com/kmantel))
13+
- Ankur Sinha ([@sanjayankur31](https://github.com/sanjayankur31))
14+
- kmantel ([@kmantel](https://github.com/kmantel))

setup.cfg

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ description = A common JSON/YAML based format for compact model specification
55
long_description = file: README.md
66
long_description_content_type = text/markdown
77
url = https://github.com/ModECI/modelspec
8-
author = Padraig Gleeson; ...
8+
author = ModECI contributors
99
author_email = [email protected]
10-
maintainer = Padraig Gleeson; ...
10+
maintainer = Padraig Gleeson, David Turner
1111
maintainer_email = [email protected]
1212
license = LGPLv3
1313
license_files = LICENSE

src/modelspec/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
__version__ = "0.3.1"
1+
__version__ = "0.3.2"
22

33
from .base_types import Base, define, has, field, fields, optional, instance_of, in_
44

test_all.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ pytest tests -v
3636

3737
cd docs
3838
python generate.py
39+
python contributors.py
3940
cd sphinx
4041
make clean
4142
make html

0 commit comments

Comments
 (0)