-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix messy notebook diffs. Merge branch 'main' into add-draw-bipartite
- Loading branch information
Showing
19 changed files
with
283 additions
and
39 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: Check URLs | ||
|
||
on: [push] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: urls-checker | ||
uses: urlstechie/urlchecker-action@master | ||
with: | ||
# A comma-separated list of file types to cover in the URL checks | ||
file_types: .md,.py,.rst,ipynb | ||
|
||
# Choose whether to include file with no URLs in the prints. | ||
print_all: false | ||
|
||
# The timeout seconds to provide to requests, defaults to 5 seconds | ||
timeout: 5 | ||
|
||
# How many times to retry a failed request (each is logged, defaults to 1) | ||
retry_count: 3 | ||
|
||
# choose if the force pass or not | ||
force_pass : false |
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,41 @@ | ||
# This workflow will upload a Python Package using Twine when a release is created | ||
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries | ||
|
||
# This workflow uses actions that are not certified by GitHub. | ||
# They are provided by a third-party and are governed by | ||
# separate terms of service, privacy policy, and support | ||
# documentation. | ||
|
||
name: Upload XGI to PyPI | ||
|
||
on: | ||
release: | ||
types: [published] | ||
workflow_dispatch: | ||
|
||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.11' | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install setuptools | ||
- name: Build package | ||
run: | | ||
python setup.py sdist | ||
- name: Publish package | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.PYPI_API_TOKEN }} | ||
skip-existing: true |
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
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,75 @@ | ||
async function fetch_JSON_file(url) { | ||
try { | ||
const response = await fetch(url); | ||
|
||
if (!response.ok) { | ||
throw new Error(response); | ||
} | ||
|
||
const json_data = await response.json(); | ||
return json_data; | ||
} catch (error) { | ||
console.error('Error fetching JSON:', error); | ||
} | ||
} | ||
|
||
function create_table(json_data) { | ||
const body = document.body; | ||
const section = document.getElementById("network-statistics") | ||
const table = document.createElement('table'); | ||
const table_header = document.createElement('thead') | ||
const table_body = document.createElement('tbody') | ||
|
||
// Create header row | ||
const header_row = document.createElement('tr'); | ||
const headers = ["Dataset", "|V|", "|E|", "|E<sub>unique</sub>|", "s<sub>max</sub>"] | ||
const header_attrs = ["num-nodes", "num-edges", "num-unique-edges", "max-edge-size"] | ||
|
||
for (const i in headers) { | ||
const h = document.createElement('th'); | ||
h.innerHTML = headers[i]; | ||
header_row.appendChild(h) | ||
} | ||
table_header.appendChild(header_row) | ||
|
||
// Create data rows | ||
for (const key in json_data) { | ||
const data_row = document.createElement('tr'); | ||
|
||
// dataset name | ||
const td_name = document.createElement('td'); | ||
const url = json_data[key]["url"].split("/files")[0] | ||
td_name.innerHTML = '<a href=' + url + '>' + key + '</a>'; | ||
data_row.appendChild(td_name); | ||
|
||
for (const i in header_attrs){ | ||
const td = document.createElement('td'); | ||
const attr = header_attrs[i] | ||
if (json_data[key][attr]) { | ||
td.textContent = json_data[key][attr]; | ||
} | ||
else { | ||
td.textContent = "N/A" | ||
} | ||
data_row.appendChild(td); | ||
} | ||
table_body.appendChild(data_row); | ||
} | ||
table.appendChild(table_header) | ||
table.appendChild(table_body) | ||
console.log(table) | ||
section.appendChild(table); | ||
} | ||
|
||
function display_table(){ | ||
url = 'https://raw.githubusercontent.com/xgi-org/xgi-data/main/index.json'; | ||
data = fetch_JSON_file(url) | ||
.then(data => { | ||
// Handle the JSON data | ||
create_table(data); | ||
}) | ||
.catch(error => { | ||
// Handle errors | ||
console.error('Error:', error); | ||
}); | ||
} |
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
File renamed without changes.
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
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
Oops, something went wrong.