From 6de5894418107d3e1fa9a041c5a60697977323ea Mon Sep 17 00:00:00 2001 From: "C.-W. HSU" <11950284+chiaweh2@users.noreply.github.com> Date: Mon, 18 Nov 2024 13:28:00 -0700 Subject: [PATCH] change the dev instruction --- README.md | 78 +++++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 59 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index b4cdb17..0460369 100644 --- a/README.md +++ b/README.md @@ -12,23 +12,30 @@ Future availability of a more sophisticated python pakcage for various end-user We welcome external contribution to the package. Please feel free to submit issue for any inputs and joining the development core team. Thank you! -## Active developement -To use the module in the package at this stage -1. Create a conda/mamba env based on the region_mom.yml +## Setting up the developement environment + +1. Fork this repository using the button in the upper right of the GitHub page. This will create a copy of the repository in your own GitHub profile, giving you full control over it. + +2. Clone the repository to your local machine from your forked version. ``` - conda env create -f regional_mom6.yml + git clone ``` -3. Activate the conda env `regional_mom6` + This create a remote `origin` to your forked version (not the NOAA-CEFI-Portal version) + + +1. Create a conda/mamba env based on the environment.yml ``` - conda activate regional_mom6 + cd regional_mom6/ + conda env create -f environment.yml ``` -4. change your location to the top level of cloned repo +3. Activate the conda env `regional-mom6` ``` - cd /regional_mom6/ + conda activate regional-mom6 ``` + 5. pip install the package in develop mode ``` @@ -36,17 +43,50 @@ To use the module in the package at this stage ``` 6. setup config file (data path for local data directory) - ``` - cp config.json.template config.json - ``` - - open the `config.json` and input the absolute path to the top level of the regional mom6 data + ``` + cp config.json.template config.json + ``` + + open the `config.json` and input the absolute path to the top level of the regional mom6 data + + ``` + { + "data_path": "" + } + ``` + + current setup assuming the data directory structure is fixed (i.e. the historical run or forecast data subdirectory (ex: hist_run and forecast) need to be under this data_path ) + +## Syncing with the NOAA-CEFI-Portal version +3. Create a remote `upstream` to track the changes that is on NOAA-CEFI-Portal + + ``` + git remote add upstream git@github.com:NOAA-CEFI-Portal/regional_mom6.git + ``` +4. Create a feature branch to make code changes + + ``` + git branch + git checkout + ``` + This prevents making direct changes to the `main` branch in your local repository. + +5. Sync your local repository with the upstream changes regularly + + ``` + git fetch upstream + git checkout main + git merge upstream/main + ``` + This updates your local `main` branch with the latest changes from the upstream repository. Remember to merge `main` into your local `` branch to keep it up to date. + +5. Push your changes to your forked version on GitHub + + ``` + git push origin + ``` + Make sure you have included the `upstream/main` changes before creating a pull request on NOAA-CEFI-Portal/regional_mom6 + - ``` - { - "data_path": "" - } - ``` - current setup assuming the data directory structure is fixed (i.e. the historical run or forecast data subdirectory (ex: hist_run and forecast) need to be under this data_path )