If you use this book, please cite it as follows:
We welcome contribution to this book. Because this is the draft of a textbook, we are still exploring ways to homogeneize the format of the books. We accept the following main threads of research:
- CyberInfrastructure content (e.g., how to use HPC, how to use the Cloud, open science) that does not replicate content from other sources and that is relevant to seismological research.
- Core Software content: how to use a core package such as SPECFEM, noisepy, seisbench etc. The tutorials should be described as simple, boiler-plate example on how to use these packages that are the core of a research workflow.
- Research Workflow: these are fullstack notebooks that leverage CI and core software for specific research question. We will welcome a few to exemplify current research practices.
We welcome contributions to this book! Follow the steps below to set up your environment, add your content, and ensure it appears correctly in the book.
- Clone the repository
git clone https://github.com/SeisSCOPED/HPS-book.git
cd HPS-book
- Create and Activate a Conda Environment: Ensure you have Conda installed. We recommend miniconda or mamba.
conda env create -f environment.yml
conda activate hps-book
-
Add Rendered Notebooks: Place your rendered Jupyter notebooks (
.ipynbfiles) or markdown files (.mdfiles) in the appropriate directory within thebookdirectory. For example, if you are adding a new tutorial, you might place it inbook/tutorials. -
Modify the Table of Contents (TOC): Update the
_toc.ymlfile to include your new content. This file controls the structure of the book and how the chapters appear in the sidebar.
Open _toc.yml and add an entry for your new content. For example:
- file: intro
- part: Tutorials
chapters:
- file: tutorials/your_new_tutorial
Ensure the path to your file is correct and relative to the book directory.
- Notebook Formatting:
- Ensure your notebooks are clean and free of unnecessary output. You can clear the output by going to
Kernel -> Restart & Clear Outputin Jupyter Notebook. - Use headings (
#,##,###, etc.) to structure your content. - Add markdown cells to explain your code and results.
- Ensure your notebooks are clean and free of unnecessary output. You can clear the output by going to
- Markdown File Formatting:
- Use proper markdown syntax for headings, lists, links, images, etc.
- Ensure your markdown files have a title at the top using a level 1 heading (
#).
- Build the book In the repository main directory, type
jb build book/
- Preview the book
You can preview the book by opening the
_build/html/index.htmlfile in your web browser.
- Commit Your Changes:
git add .
git commit -m "Add new tutorial on [topic]"
- Push Your Changes:
git push origin your-branch-name
- Create a Pull Request: Go to the repository on GitHub and create a pull request. Provide a clear description of your changes and the content you have added.
Here’s an example of how to format a Jupyter notebook to ensure it appears nicely in the book:
# Title of Your Tutorial
## Introduction
Provide an introduction to your tutorial. Explain what the reader will learn and any prerequisites.
## Step 1: Setup
Explain the setup process. Include any necessary code.
```python
# Example setup code
import numpy as np
import matplotlib.pyplot as plt
::notes:: To improve pedagogy, we recommend that notebooks are designed to include student-led activities with empty cells, and provide avenues to change parameters in the workflows.
Provide the main content of your tutorial. Use markdown cells to explain each step.
# Example code
x = np.linspace(0, 10, 100)
y = np.sin(x)
plt.plot(x, y)
plt.title("Sine Wave")
plt.show()
Summarize what the reader has learned and provide any additional resources or next steps.
### Example of a Well-Formatted Markdown File
Here’s an example of how to format a markdown file to ensure it appears nicely in the book:
```markdown
# Title of Your Tutorial
## Introduction
Provide an introduction to your tutorial. Explain what the reader will learn and any prerequisites.
## Step 1: Setup
Explain the setup process. Include any necessary code.
```python
# Example setup code
import numpy as np
import matplotlib.pyplot as plt
This repository was made by a GEOSMART template and has the skeleton of a GeoSMART use case book in chapter ML in Seismology. The original authors were Scott Henderson (UW) and other friends at the eScience Institute. Below is how to reuse the template
-
Click "Use This Template" and name your repository
-
In your repository edit book/_config.yml
-
Under your repository Settings --> Pages --> Source = GitHub Actions
-
Edit environment.yml, modify notebooks, and your JupyterBook will be published for you!