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

format notebooks with isort #502

Merged
merged 2 commits into from
Feb 12, 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
2 changes: 1 addition & 1 deletion HOW_TO_CONTRIBUTE.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Please note we have a [code of conduct](/CODE_OF_CONDUCT.md), please follow it i
4. [Optional, but STRONGLY preferred] Include any new method/function in the corresponding docs file.
5. Run `pytest` to verify all unit tests pass.
6. [Optional, but STRONGLY preferred] Run `pylint xgi/ --disable all --enable W0611` and remove any unnecessary dependencies.
7. [Optional, but STRONGLY preferred] Run `isort .` to sort any new import statements.
7. [Optional, but STRONGLY preferred] Run `isort .` and `nbqa isort .` to sort any new import statements in the source code and tutorials.
8. [Optional, but STRONGLY preferred] Run `black .` for consistent styling.
9. Update the "Current Version" section of CHANGELOG.md with overview of changes to the interface and add the usernames of all contributors.
10. Submit Pull Request with a list of changes, links to issues that it addresses (if applicable)
Expand Down
1 change: 1 addition & 0 deletions docs/source/api/tutorials/In Depth 1 - Drawing nodes.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"source": [
"import matplotlib.pyplot as plt\n",
"import numpy as np\n",
"\n",
"import xgi"
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@
"metadata": {},
"outputs": [],
"source": [
"import xgi\n",
"import matplotlib.pyplot as plt\n",
"import numpy as np\n",
"import matplotlib.pyplot as plt"
"\n",
"import xgi"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@
"metadata": {},
"outputs": [],
"source": [
"import xgi\n",
"import matplotlib.pyplot as plt\n",
"import numpy as np\n",
"import matplotlib.pyplot as plt"
"\n",
"import xgi"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@
"metadata": {},
"outputs": [],
"source": [
"import xgi\n",
"import matplotlib.pyplot as plt\n",
"import numpy as np\n",
"import matplotlib.pyplot as plt"
"\n",
"import xgi"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,12 @@
"metadata": {},
"outputs": [],
"source": [
"import xgi\n",
"import random\n",
"\n",
"import numpy as np\n",
"import pandas as pd\n",
"import numpy as np"
"\n",
"import xgi"
]
},
{
Expand Down
5 changes: 3 additions & 2 deletions docs/source/api/tutorials/Tutorial 2 - Read and Write.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@
"metadata": {},
"outputs": [],
"source": [
"import xgi\n",
"import random"
"import random\n",
"\n",
"import xgi"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@
},
"outputs": [],
"source": [
"import xgi\n",
"import random\n",
"\n",
"import numpy as np\n",
"import pandas as pd\n",
"import numpy as np"
"\n",
"import xgi"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@
},
"outputs": [],
"source": [
"import xgi\n",
"import random\n",
"\n",
"import numpy as np\n",
"import random"
"\n",
"import xgi"
]
},
{
Expand Down
6 changes: 4 additions & 2 deletions docs/source/api/tutorials/Tutorial 5 - Plotting.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,12 @@
"metadata": {},
"outputs": [],
"source": [
"import matplotlib.pyplot as plt\n",
"import itertools\n",
"import numpy as np\n",
"import random\n",
"\n",
"import matplotlib.pyplot as plt\n",
"import numpy as np\n",
"\n",
"import xgi"
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"outputs": [],
"source": [
"import matplotlib.pyplot as plt\n",
"\n",
"import xgi"
]
},
Expand Down
5 changes: 3 additions & 2 deletions docs/source/api/tutorials/XGI in 15 minutes.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@
"metadata": {},
"outputs": [],
"source": [
"import xgi\n",
"import matplotlib.pyplot as plt\n",
"import numpy as np\n",
"import matplotlib.pyplot as plt"
"\n",
"import xgi"
]
},
{
Expand Down
5 changes: 3 additions & 2 deletions docs/source/api/tutorials/XGI in 5 minutes.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@
"metadata": {},
"outputs": [],
"source": [
"import xgi\n",
"import matplotlib.pyplot as plt\n",
"import numpy as np\n",
"import matplotlib.pyplot as plt"
"\n",
"import xgi"
]
},
{
Expand Down
2 changes: 2 additions & 0 deletions docs/source/api/tutorials/case_study_zhang2022.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@
"outputs": [],
"source": [
"# utility functions to compute the Lyapunov exponents from the Laplacians\n",
"\n",
"\n",
"def compute_eigenvalues(H, order, weight, rescale_per_node=True):\n",
" \"\"\"Returns the Lyapunov exponents of corresponding to the Laplacian of order d.\n",
"\n",
Expand Down
10 changes: 6 additions & 4 deletions docs/source/api/tutorials/quickstart.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,14 @@
"metadata": {},
"outputs": [],
"source": [
"import xgi\n",
"import matplotlib.pyplot as plt\n",
"import networkx as nx\n",
"import numpy as np\n",
"import pandas as pd\n",
"from IPython.display import display\n",
"from matplotlib.pyplot import cm\n",
"import matplotlib.pyplot as plt\n",
"import networkx as nx"
"\n",
"import xgi"
]
},
{
Expand Down Expand Up @@ -849,10 +850,11 @@
}
],
"source": [
"import xgi\n",
"import numpy as np\n",
"import pandas as pd\n",
"\n",
"import xgi\n",
"\n",
"H_stats = xgi.Hypergraph([[1, 2, 3], [2, 3, 4, 5], [3, 4, 5]])\n",
"H_stats.degree()"
]
Expand Down
5 changes: 3 additions & 2 deletions docs/source/api/tutorials/simplicial_kuramoto_example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@
"metadata": {},
"outputs": [],
"source": [
"import xgi\n",
"import matplotlib.pyplot as plt\n",
"import numpy as np\n",
"import matplotlib.pyplot as plt"
"\n",
"import xgi"
]
},
{
Expand Down
3 changes: 2 additions & 1 deletion requirements/developer.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
black[jupyter]==22.3.0
pre-commit>=2.12
isort==5.10.1
pylint>=2.10
pylint>=2.10
nbqa
Loading