diff --git a/.gitignore b/.gitignore index 325996ec0..e8dfebd21 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,7 @@ 06-instructors/find_duplicate_packages.sh __pycache__/ .ipynb_checkpoints -tmp/ \ No newline at end of file +tmp/ +uv.lock +lcr-env +.venv diff --git a/README.md b/README.md index 98d79382a..df5b8a51c 100644 --- a/README.md +++ b/README.md @@ -75,7 +75,7 @@ The technical facilitator will introduce the concepts through a collaborative li * Participants are encouraged to ask questions and collaborate with others to enhance learning. * Participants must have a computer and an internet connection to participate in online activities. * Participants must not use generative AI such as ChatGPT to generate code to complete assignments. It should be used as a supportive tool to seek out answers to questions you may have. -* We expect participants to have completed the steps in the [onboarding repo](https://github.com/UofT-DSI/Onboarding/tree/tech-onboarding-docs). +* We expect participants to have completed the steps in the [onboarding repo](https://github.com/UofT-DSI/onboarding/blob/main/environment_setup/README.md). * We encourage participants to default to having their camera on at all times and turning the camera off only as needed. This will greatly enhance the learning experience for all participants and provides real-time feedback for the instructional team. ## Resources @@ -127,6 +127,8 @@ Alternative Textbook: [Data Science: A First Introduction](https://python.datasc ├── 03_instructional_team ├── 04_this_cohort ├── LICENSE +├── SETUP.md +├── pyproject.toml └── README.md ``` @@ -137,5 +139,7 @@ Alternative Textbook: [Data Science: A First Introduction](https://python.datasc * **this_cohort**: Additional materials and resources for this cohort. * **.gitignore**: Files to exclude from this folder, specified by the Technical Facilitator * **LICENSE**: The license for this repository. +* **SETUP.md**: Contains the steps required to set up this repo for the module. +* **pyproject.toml**: Tells Python which packages this repo needs to run. * **README.md**: This file. diff --git a/SETUP.md b/SETUP.md new file mode 100644 index 000000000..7d719dce4 --- /dev/null +++ b/SETUP.md @@ -0,0 +1,67 @@ +# Setup +## Environment Setup Guide +Before using this repo, make sure you’ve completed the [environment setup guide](https://github.com/UofT-DSI/onboarding/blob/main/environment_setup/README.md), which installs the core tools you’ll need for this module, such as: + +- Git +- Git Bash (for Windows) +- Visual Studio Code +- UV + +## Necessary Packages +The "Linear regression, classification, and resampling" module uses its own isolated environment called `lcr-env` so that packages don’t conflict with other projects. +We use UV to create this environment, activate it, and install the required packages listed in the module’s `pyproject.toml`. +This setup only needs to be done **once per module**, after that, you just activate the environment whenever you want to work in this repo. + + +Open a terminal (macOS/Linux) or Git Bash (Windows) in this repo, and run the following commands in order: + +1. Create a virtual environment called `lcr-env`: + ``` + uv venv lcr-env --python 3.11 + ``` + +2. Activate the environment: + - for macOS/Linux: + ``` + source lcr-env/bin/activate + ``` + + - for windows (git bash): + ``` + source lcr-env/Scripts/activate + ``` + +3. Install all required packages from the [pyproject.toml](./pyproject.toml) + ```bash + uv sync --active + ``` + +## Environment Usage +In order to run any code in this repo, you must first activate its environment. +- for macOS/Linux: + ``` + source lcr-env/bin/activate + ``` + +- for windows (git bash): + ``` + source lcr-env/Scripts/activate + ``` + +When the environment is active, your terminal prompt will change to show: +``` +(lcr-env) $ +``` +This is your **visual cue** that you’re working inside the right environment. + +When you’re finished, you can deactivate it with: +```bash +deactivate +``` + +> **👉 Remember** +> Only one environment can be active at a time. If you switch to a different repo, first deactivate this one (or just close the terminal) and then activate the new repo’s environment. + +--- + +For questions or issues, please contact the "Linear regression, classification, and resampling" Module learning support team or email courses.dsi@utoronto.ca. \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 000000000..f131de7d5 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,16 @@ +[project] +name = "lcr-env" +version = "0.1.0" +requires-python = ">=3.11" +dependencies = [ + "ipykernel>=6.30.1", + "kaleido>=1.1.0", + "matplotlib>=3.10.6", + "numpy>=2.3.3", + "pandas>=2.3.2", + "plotly>=6.3.0", + "requests>=2.32.5", + "scikit-learn>=1.7.2", + "seaborn>=0.13.2", + "statsmodels>=0.14.5", +]