Skip to content

Commit

Permalink
PR overhall
Browse files Browse the repository at this point in the history
  • Loading branch information
RyanGroneck committed Feb 8, 2025
1 parent 108c09a commit f4233f3
Show file tree
Hide file tree
Showing 8 changed files with 180 additions and 317 deletions.
Binary file removed docs/contributing/bash_terminal.png
Binary file not shown.
3 changes: 2 additions & 1 deletion docs/contributing/contribution_guidelines.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
"metadata": {},
"source": [
"There are multiple ways in which you can help us:\n",
"\n",
"- Found a bug in STARDIS? Report it to us!\n",
"\n",
"- Caught a typo in documentation or want to make it better to understand? Edit it!\n",
Expand Down Expand Up @@ -90,7 +91,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Documentation can always be improved upon by adding missing information or making it easier to read. Lucky for you, you can make edits and fixes to the documentation pages that are stored in the `docs` directory of STARDIS. The Majority of STARDIS documentation is made using Jupyter Notebooks and Markdown, which you can learn more about [here](https://www.geeksforgeeks.org/markdown-cell-in-jupyter-notebook/).\n",
"Documentation can always be improved upon by adding missing information or making it easier to read. Lucky for you, you can make edits and fixes to the documentation pages that are stored in the `docs` directory of STARDIS. The majority of STARDIS documentation is made using Jupyter Notebooks and Markdown, which you can learn more about [here](https://www.geeksforgeeks.org/markdown-cell-in-jupyter-notebook/).\n",
"\n",
"<!-- Add a reference to something on building docs locally to test changes-->"
]
Expand Down
48 changes: 37 additions & 11 deletions docs/contributing/editing_stardis.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Now that you have installed STARDIS and hopefully set up everything you need, you can now get started on **your first Pull Request**."
"Now that you have installed STARDIS and hopefully set up everything you need, you can now get started on **your first Pull Request**, which is how you edit STARDIS!"
]
},
{
Expand Down Expand Up @@ -39,9 +39,8 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"1) Launch your Bash terminal, either using the **terminal app on Mac** or the **WSL or Ubuntu application on Windows** \n",
"\n",
"2) Navigate to your **Stardis directory**, using the commands `ls` to *list* directory options and `cd <directory_name>` to *change* to the given *directory*.\n",
"1) Launch your Command Line terminal, and navigatae to your Stardis direcotry using `cd <path/to/Stardis/directory>`. \n",
" - Your `<path/to/Stardis/directory>` will be based on where you first downloaded Stardis to. You can find this using `realpath Stardis`. \n",
"\n",
"3) Start your **Stardis Environment** by running the command `conda activate Stardis`"
]
Expand All @@ -57,9 +56,9 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"One of the main reasons we use Git is because of Git **Branches**. Branches are like off-shoots of main code, where you can make changes to a specific feature or file without immediately worrying about the broader implications of your changes. The main code is in a branch called `main` (great naming, right?)<!-- <<< Should this whimsy be removed?-->, and can be refered to as the *trunk*, because the other branches come off of it.\n",
"One of the main reasons we use Git is because of Git **Branches**. Branches are like off-shoots of main code, where you can make changes to a specific feature or file without immediately worrying about the broader implications of your changes. The main code is in a branch called `main`, and can be referred to as the *trunk*, because the other branches come off of it.\n",
"\n",
"Its important to keep in mind that when you want to start working on a new feature or change, **make a new branch for that change!** This way, when you make the Pull request to apply that change, the reviewers know exactly what your change does, and the proccess goes smoothly. \n",
"Its important to keep in mind that when you want to start working on a new feature or change, **make a new branch for that change!** This is proper procedure for a variety of reasons, like making it easier to find the source of bugs/error and making the process of adding features smoother. \n",
"\n",
"- Make a new Branch with the command: `git branch my_branch_name`\n",
"\n",
Expand All @@ -83,13 +82,13 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"While you are clicking through directories, making changes to your hearts desire, there are some things to note.\n",
"While you are clicking through directories, making changes to your heart's desire, there are some things to note.\n",
"\n",
"- The changes you make will only impact the version on STARDIS on your computer for now, so you don't have to worry about breaking anything.\n",
"- The edits you make will only impact the version on STARDIS on your computer for now, so you don't have to worry about breaking anything.\n",
"\n",
"- After editing a file, make sure to press `ctrl`+`s` to save the file. Otherwise, nothing will be saved.\n",
"- After editing a file, make sure to save your changes! Only saved changes will be included in your pull request. \n",
"\n",
"- you can use the command `git status` to remind yourself what branch you are on and see what changes you have made. Do this often!"
"- you can use the command `git status` to remind yourself what branch you are on and see what edits/additions you have made. Do this often!"
]
},
{
Expand Down Expand Up @@ -135,7 +134,7 @@
"source": [
"Here are the steps you can take to make your first PR:\n",
"\n",
"1) Run the command `git add -A`\n",
"1) Run the command `git add -A`. If you only want to push some of your edits, replace `-A` with the paths to your edited files.\n",
"\n",
"2) Run the command `git commit -m '<explanation_of_your_pr>'`\n",
" - example: git commit -m 'Typo fix in the quickstart notebook'\n",
Expand All @@ -147,6 +146,33 @@
"\n",
"You will then need to fill out a form that goes with the PR where you explain your changes. Make sure to be specific in your explanation of the changes, as well as edit the 'type' field to indicate what your changes effect."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Revising and Editing your Pull Request"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The vast majority of pull requests aren't perfect on their first iteration, even those from expert programmers! After you make your pull request it will be up to STARDIS reviewers to give it a look over and see what is good and what needs a little polish. **Don't be discouraged by this, its part of the process!** On Github you see the comments and suggestions of the STARDIS reviewers, and after some iterations, your code can get 'merged', or added to STARDIS! \n",
"\n",
"Here are some things to keep in mind when going to revise and edit your pull requests:\n",
"\n",
"- You will need to go back to the branch you made the pull request from to revise it. Go through making changes to this branch just as you did before making the request.\n",
"\n",
"- When you want to have your new changes made to your pull request, all you need to do is `add` and `commit` your branch as you did before. Your new message in your `commit` command should elaborate on what you updated, edited, or added to the request.\n",
"\n",
"- No need to go to Github and Push or Pull any changes. Because you already made the pull request, it will automatically update after you run the new commit command."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": []
}
],
"metadata": {
Expand Down
138 changes: 138 additions & 0 deletions docs/contributing/stardis_for_developers.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# STARDIS for Developers"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Before you can start contributing to STARDIS, you'll need to download and install it up on your computer. if you haven't already, go through the [Downloading and Installing STARDIS](../installation.rst) documentation, and make sure to follow the [For Developers](../installation.rst#for-developers) section when you do so.\n",
"\n",
"You'll also need a set up a [Github account](https://github.com/signup?). Github is a platform that lets you easily access, download, and make edits to online 'repositories' (shared projects) using something called 'Git'. Git is a version control system that allows for developers easily keep prior versions of code, work on features without breaking the main program, and collaborate with others."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Creating a Fork"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"\"Forking\" a repository means creating a personal copy of a project so you can make edits to it. Later, these edits can be applied to the original project through a Pull Request, often shortened to \"PR\". The instructions here are will guide you through setting up STARDIS, but you can find more general instruction [here](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/fork-a-repo) if you need extra help.\n",
"\n",
"1) Go to the [STARDIS Github page](https://github.com/tardis-sn/stardis).\n",
"\n",
"2) click **Fork**, which should be near the top right of the page.\n",
"\n",
"<div>\n",
"<img src=\"fork.png\" width=\"400\"/>\n",
"</div>\n",
"\n",
"3) By default, your account should be the Owner of this fork and \"Copy the `main` brach only\" should be selected. **click 'Create fork'**."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## SSH Key Setup"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"A SSH key is a method of identification for your Github account on your device, which allows you to avoid needing to constantly provide your Github login info when using Git to make changes to STARDIS. Here, we will show you how to set up a SSH key.\n",
"\n",
"If you get stuck somewhere along the way, you can try\n",
"\n",
"- [Github's instructions for setting up a SSH key](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent)\n",
"\n",
"- Watching this [youtube walkthrough](https://www.youtube.com/watch?v=snCP3c7wXw0)\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Generate a SSH Key"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"1) Copy this command into your Command Line terminal: `ssh-keygen -t ed25519 -C \"[email protected]\"`.\n",
" - Replace `[email protected]` with the email you used for your Github account.\n",
"\n",
"2) When prompted to enter a file to save the key in, you can just press enter. This uses the default file location.\n",
"\n",
"3) You will be prompted to create a passphrase, or password, for your key.\n",
" - Note that when you type this, what you type will not be shown; this is normal, so be careful!"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Add SHH Key to SSH Agent"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Run these commands in your Command Line Terminal:\n",
"\n",
"1) `eval \"$(ssh-agent -s)\"`\n",
"\n",
"2) `ssh-add ~/.ssh/id_ed25519`\n",
"\n",
"3) `cat ~/.ssh/id_ed25519.pub` <-- *this just copies your key to clipboard, which is used in the next step*"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Add SSH Key to Your Github Account"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"1) Open [GitHub SSH Keys](https://github.com/settings/keys)\n",
"\n",
"2) Click “New SSH Key”.\n",
"\n",
"3) In \"Title\", enter a name (e.g., \"My Laptop\").\n",
"\n",
"4) Paste the copied key into the \"Key\" field.\n",
"\n",
"5) Click \"Add SSH Key\"."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": []
}
],
"metadata": {
"language_info": {
"name": "python"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
Loading

0 comments on commit f4233f3

Please sign in to comment.