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

Tutorials as git subtree for tutorials with nbsphinx #133

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,10 @@
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = []
exclude_patterns = [
"getting_started/tutorials/tutorials_repo/README.rst",
Copy link
Member

Choose a reason for hiding this comment

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

The tutorials repo README.rst might not stay excluded, but good for now and good to see how it's done.
Good idea to exclude the demos!

"getting_started/tutorials/tutorials_repo/demos",
]


# -- Options for HTML output -------------------------------------------------
Expand Down
11 changes: 11 additions & 0 deletions docs/source/developing/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,17 @@ And then run command for testing with ``--external`` option::
pytest tests --external


Maintaining a copy of the tutorials with ``git subtree``
********************************************************

The tutorials for ixdat is developed in a
`separate repository <https://github.com/ixdat/tutorials>`_. But these tutorials are copied into
the ixdat repository in order to be able to generate docs from the Jupyter notebooks. This copy
is maintained via a git feature called ``git subtree``. The copy of the tutorials in ixdat can
be updated with new changes with the following command::

git subtree pull --prefix docs/source/getting_started/tutorials/tutorials_repo https://github.com/ixdat/tutorials.git main --squash
Copy link
Member

Choose a reason for hiding this comment

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

Nice! This works for me :)


Write to us
***********
We'd love to know what you're working on and help with any issues developing, even
Expand Down
Binary file not shown.
Binary file not shown.

This file was deleted.

10 changes: 5 additions & 5 deletions docs/source/getting_started/tutorials/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ https://github.com/ixdat/tutorials/blob/main/L1_basic_concepts/01_Readers.ipynb
.. toctree::
:maxdepth: 1

L1_basic_concepts/01_readers.ipynb
tutorials_repo/L1_basic_concepts/01_Readers.ipynb


.. _ec_tutorials:
Expand All @@ -79,7 +79,7 @@ https://github.com/ixdat/tutorials/blob/main/L2_techniques/electrochemistry/02_c
.. toctree::
:maxdepth: 1

L2_techniques/electrochemistry/02_comparing_cycles
tutorials_repo/L2_techniques/electrochemistry/02_comparing_cycles


.. _ecms_tutorial:
Expand All @@ -91,7 +91,7 @@ https://github.com/ixdat/tutorials/blob/main/L2_techniques/ec_ms_quantification/
.. toctree::
:maxdepth: 1

L2_techniques/ec_ms_quantification/EC-MS_ixdat_tutorial
tutorials_repo/ec_ms_quantification/EC-MS_ixdat_tutorial

.. _sec_tutorial:

Expand All @@ -102,7 +102,7 @@ https://github.com/ixdat/tutorials/blob/main/L2_techniques/spectroelectrochemist
.. toctree::
:maxdepth: 1

L2_techniques/spectroelectrochemistry/spectroelectrochemistry_demo
tutorials_repo/L2_techniques/spectroelectrochemistry/spectroelectrochemistry_demo


.. _data_tutorial:
Expand All @@ -114,7 +114,7 @@ https://github.com/ixdat/tutorials/blob/main/L3_data_structure/01_reading_and_us
.. toctree::
:maxdepth: 1

L3_data_structure/01_reading_and_using_data
tutorials_repo/L3_data_structure/01_reading_and_using_data


This repository is a bit of a mess at the moment, apologies, but the tutorials themselves are
Expand Down
139 changes: 139 additions & 0 deletions docs/source/getting_started/tutorials/tutorials_repo/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
# pycharm
.idea/

# data
data/

# renderings
*.png
*.jpg

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
.python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@
from pathlib import Path


data_dir = (
Path.home()
/ "Dropbox/ixdat_resources/presentations_and_workshops/22K16_ICL_quant/2022-09-27 21_15_42 22I27_London"
)
data_dir = Path.home() / "Dropbox/ixdat_resources/presentations_and_workshops/22K16_ICL_quant/2022-09-27 21_15_42 22I27_London"

for f in data_dir.iterdir():
print(f)
Expand Down Expand Up @@ -37,33 +34,41 @@
n_el=-2,
tspan_bg=[50, 100],
selector_list=[2, 5, 8],
t_steady_pulse=30,
t_steady_pulse=30
)
cal_O2_M32_EC = ecms.ecms_calibration_curve(
mol="O2",
mass="M32",
n_el=4, # 2 H2O --> O2 + 4 (H+ + e-)
tspan_bg=[50, 100],
selector_list=[10, 12, 14],
t_steady_pulse=30,
t_steady_pulse=30
)
cal_CO2_M44_EC = ecms.ecms_calibration_curve(
mol="CO2",
mass="M44",
n_el=2,
tspan_bg=[2520, 2540],
selector_list=[28, 32, 34],
t_steady_pulse=30,
t_steady_pulse=30
)

cal_He = ecms.gas_flux_calibration(mol="He", mass="M4", tspan=[0, 50])
cal_CO = ecms.gas_flux_calibration(mol="CO", mass="M28", tspan=[2800, 2850])
cal_He = ecms.gas_flux_calibration(
mol="He",
mass="M4",
tspan=[0, 50]
)
cal_CO = ecms.gas_flux_calibration(
mol="CO",
mass="M28",
tspan=[2800, 2850]
)

cal_air = ms.multicomp_gas_flux_calibration(
mol_list=["N2", "O2", "Ar"],
mass_list=["M28", "M32", "M40"],
gas={"N2": 0.79, "O2": 0.20, "Ar": 0.01},
tspan=[7100, 7200],
tspan=[7100, 7200]
)

from ixdat.si_quant_patch import append_sensitivity_factors
Expand All @@ -78,5 +83,7 @@
ax.get_figure().savefig("calibration_trend.png")


ecms.set_quantifier(calibration=calibration, mol_list=["CO2"], mass_list=["M44"])
ecms.export(mol_list=["CO2"], mass_list=["M44"])
ecms.set_quantifier(
calibration=calibration, mol_list=["CO2"], mass_list=["M44"]
)
ecms.export(mol_list=["CO2"], mass_list=["M44"])
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"# co_strip = CyclicVoltammagram.read(d\"../loading_appending_and_saving/co_strip.csv\", reader=\"ixdat\")\n",
"if True: # Set this to False for offline work (requires you have downloaded the data file.)\n",
" co_strip = CyclicVoltammogram.read_url(\n",
" \"https://raw.githubusercontent.com/ixdat/tutorials/main/L3_data_structure/exports/co_strip.csv\",\n",
" \"https://raw.githubusercontent.com/ixdat/tutorials/main/electrochemistry/data/co_strip.csv\",\n",
" reader=\"ixdat\"\n",
" )\n",
"else:\n",
Expand Down Expand Up @@ -452,7 +452,7 @@
"# oxide_reduction = CyclicVoltammagram.read(data_directory / \"oxide_reduction.csv\", reader=\"ixdat\")\n",
"if True: # Set this to False for offline work (requires you have downloaded the data file.)\n",
" oxide_reduction = CyclicVoltammogram.read_url(\n",
" \"https://raw.githubusercontent.com/ixdat/tutorials/main/L3_data_structure/exports/oxide_reduction.csv\",\n",
" \"https://raw.githubusercontent.com/ixdat/tutorials/main/electrochemistry/data/oxide_reduction.csv\",\n",
" reader=\"ixdat\"\n",
" )\n",
"else:\n",
Expand All @@ -477,7 +477,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
Expand All @@ -491,7 +491,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.13"
"version": "3.7.4"
}
},
"nbformat": 4,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
plt.close("all")

meas = CV.read_url(
"https://raw.githubusercontent.com/ixdat/tutorials/main/L3_data_structure/exports/oxide_reduction.csv",
"https://raw.githubusercontent.com/ixdat/tutorials/main/electrochemistry/data/oxide_reduction.csv",
reader="ixdat",
)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
ixdat version = 0.2.5
ixdat version = 0.2.0dev
name = extended_platinum_ec
technique = EC
tstamp = 1580476422.056785
tstamp = 1580480022.056785
backend_name = BackendBase(none, address=none)
id = 8
id = 7
timecol 'time/s' for: '$U_{RHE}$ / [V]' and '<I>/mA' and 'selector'
aliases = {"t": ["time/s"], "raw_potential": ["$U_{RHE}$ / [V]"], "raw_current": ["raw_current=0", "<I>/mA", "I/mA"], "cycle": ["cycle number"]}
aliases = {"t": ["time/s"], "raw_potential": ["$U_{RHE}$ / [V]"], "raw_current": ["<I>/mA"], "selector": ["selector"]}
N_header_lines = 11

time/s, $U_{RHE}$ / [V], <I>/mA, selector
Expand Down