diff --git a/portfolio/portfolio.py b/portfolio/portfolio.py index e55019df7..86448758c 100644 --- a/portfolio/portfolio.py +++ b/portfolio/portfolio.py @@ -310,6 +310,7 @@ def index( prod: bool = False, ) -> None: sites = [] + Path("/portfolio/index").mkdir(parents=True, exist_ok=True) for site in os.listdir("./portfolio/sites/"): with open(f"./portfolio/sites/{site}") as f: name = site.replace(".yml", "") diff --git a/portfolio/template_README.md b/portfolio/template_README.md new file mode 100644 index 000000000..d88915082 --- /dev/null +++ b/portfolio/template_README.md @@ -0,0 +1,40 @@ +# Purpose of this Template +To create uniformity across our [portfolio](https://analysis.calitp.org/), here is a template that outlines suggested sections that your website's `README.md` could cover. Adjust the template as you see fit. Delete this verbiage after you are done populating the template and are ready to publish. + +# Title of Your Project +Outline why you pursued this project. +* What research question(s) and topic(s) does your work address? +* What is the intent of your work? +* Why is this relevant? +* Who is the intended audience for this product? +* How do you intend for the stakeholders to use it? +* What is the impact your research will have? +* How often is this website updated with new data? Monthly/quarterly/annually? +* Add a link to the folder that houses your code. + +## Definitions +The narrative portion of your work can contain terms that are unclear. For example, what does peak and off-peak hours mean? Or early, late, and on-time? Although MPO is easily searched, perhaps that can benefit from being defined. + +## Methodology +Detail the analytical decisions you made for your work. What did you do? How did you do it? Why did you approach your work a certain way? Here are some questions that will provide some food for thought. + +* What datasets did you use? +* Why did you choose these datasets? +* Where did these datasets come from? +* What aggregations did you do on your datasets? Why did you choose this particular grain? +* What were the steps you took to get to your results? +* Why did you choose a particular date/time period? +* Why did you choose the metrics you did? How did you calculate your metrics? + +## Frequently Asked Questions +If you foresee that there will be parts of your work that will spark some questions and curiosity from people viewing your work, you can add these potential questions to this FAQ portion. You can also add your contact information if you anticipate questions. + +## Data Sources +Use this section to send users to the appropriate links to download/view the data you used to create your websites. If the methodology section above doesn't apply to your website, you can write about the data sources you used here. Below is some language you can use, if the data is uploaded to our public GCS folder. + +To download the data that powers this website, please navigate to the folder titled `insert folder name, keep the back ticks` [here](insert link here). You will find the most recent datasets available in `insert the file extensions available` formats. We renamed some of the column names for readability and you can match the [readable column names](insert link to readable.yml) to the original column names. + +## Who We Are +We want our audience to understand who we are and why our expertise and research should be trusted. Here is a blurb you can lift. + +This website was created by the [California Department of Transportation](https://dot.ca.gov/)'s Division of Data and Digital Services. We are a group of data analysts and scientists who analyze transportation data, such as General Transit Feed Specification (GTFS) data, or data from funding programs such as the Active Transportation Program. Our goal is to transform messy and indecipherable original datasets into usable, customer-friendly products to better the transportation landscape. For more of our work, visit our [portfolio](https://analysis.calitp.org/). diff --git a/starter_kit/param_nb1.png b/starter_kit/param_nb1.png deleted file mode 100644 index f798d37a3..000000000 Binary files a/starter_kit/param_nb1.png and /dev/null differ diff --git a/starter_kit/param_nb2.png b/starter_kit/param_nb2.png deleted file mode 100644 index eec387bd9..000000000 Binary files a/starter_kit/param_nb2.png and /dev/null differ diff --git a/starter_kit/parameterized_notebook.ipynb b/starter_kit/parameterized_notebook.ipynb deleted file mode 100644 index a9878c68f..000000000 --- a/starter_kit/parameterized_notebook.ipynb +++ /dev/null @@ -1,175 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "id": "5dc82218-7670-440a-8c96-183ef1dc4918", - "metadata": {}, - "source": [ - "# How to set up a parameterized notebook.\n", - "* This notebook corresponds with [this page](https://docs.calitp.org/data-infra/publishing/sections/5_notebooks_styling.html#parameterized-titles) in our docs.\n", - "* You must have all of these elements in order for the parameterization process to work." - ] - }, - { - "cell_type": "markdown", - "id": "46c39238-fb2c-42be-998c-81f8881e1f5e", - "metadata": {}, - "source": [ - "## Step 1: Add Packages\n", - "* The first cell should contain the lines of code below in this exact order." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "c7edb281-4538-4027-8524-e6280d30f637", - "metadata": {}, - "outputs": [], - "source": [ - "%%capture\n", - "import calitp_data_analysis.magics\n", - "import warnings\n", - "warnings.filterwarnings(\"ignore\")\n", - "\n", - "# Rest of your packages here " - ] - }, - { - "cell_type": "markdown", - "id": "eda8a18e-de15-4cf0-8f63-7b87264e5ca0", - "metadata": { - "tags": [ - "parameters" - ] - }, - "source": [ - "## Step 2: Your Parameter\n", - "* Let's say you want to use one Jupyter notebook as a template to display insights for every Caltrans District. You essentially want to populate the notebook 12 times with the 12 districts. As such, something like `district` would be our parameter.\n", - "* To set this up:\n", - " 1. Tag the first cell as a parameter.
\n", - " * In this case our parameter would `district = \"whatever district you want\"`.\n", - " * Leave this cell commented out. \n", - " * To tag this cell as a parameter, go to the code cell go to the upper right hand corner -> click on the gears -> go to \"Cell Tags\" -> Add Tag + -> add a tag called \"parameters\" -> click on the new \"parameters\" tag to ensure a checkmark shows up and it turns dark gray.
\n", - " \n", - " 2. In the second cell, with `%%capture_parameters` input the same parameter without any assigned value.\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "c2a60b32-91f4-436f-8fef-7def7742f4e3", - "metadata": { - "tags": [ - "parameters" - ] - }, - "outputs": [], - "source": [ - "# district = \"4\"" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "cde62ae4-89a0-41f9-9f3d-1550c5bfda37", - "metadata": {}, - "outputs": [], - "source": [ - "%%capture_parameters\n", - "district" - ] - }, - { - "cell_type": "markdown", - "id": "0b39dec3-eed9-4028-9caa-2e3938eaa085", - "metadata": {}, - "source": [ - "## Step 3: Create Table of Content\n", - "* `# {district}` in the markdown cell below creates the Table of Contents on the left hand side used to navigate your GitHub pages.
\n", - "* You must have this cell. Without this, the notebooks will be parameterized but then there'd be no table contents to list out the pages for people to see.\n", - "* Note, any styling (italicizing, bolding, changing the colors) you use in the markdown cell below will reflect in the Table of Contents.
\n", - "* Below, you can see District 1: Eureka is displayed as the first header and is also the page's name in the Table of Content
\n", - "" - ] - }, - { - "cell_type": "markdown", - "id": "93362077-1b4a-4c53-a49a-531ce3c669cc", - "metadata": {}, - "source": [ - "# {district}" - ] - }, - { - "cell_type": "markdown", - "id": "beccfe91-ca5d-4a98-8f7d-5638eeb1a3ff", - "metadata": { - "tags": [] - }, - "source": [ - "## Just a note about headers\n", - "* All headers must be in consecutive order or else the parameterized notebooks will not build as shown below." - ] - }, - { - "cell_type": "markdown", - "id": "242ecc72-9a88-4bb4-9530-25335b8a10ba", - "metadata": { - "tags": [] - }, - "source": [ - "# {district}\n", - "* This is the basis of the Table of Contents in the Portfolio.\n", - "* Ensure it is of the header one type. " - ] - }, - { - "cell_type": "markdown", - "id": "e0d10771-687b-4062-8eb3-8c4af91e3bc2", - "metadata": {}, - "source": [ - "## This is my second header.\n", - "* Using `##`" - ] - }, - { - "cell_type": "markdown", - "id": "20848cd7-b33e-496b-bfa4-2b8ff28fb9d5", - "metadata": {}, - "source": [ - "### This is my third header.\n", - "* Using `###`" - ] - }, - { - "cell_type": "markdown", - "id": "3acf4b9d-9f01-4f0c-a619-4578a4892646", - "metadata": {}, - "source": [ - "## You're now finished setting up your parameterized notebook. \n", - "* [Read the docs here to see how to create the yml file and deploy it.](https://docs.calitp.org/data-infra/publishing/sections/4_analytics_portfolio_site.html)" - ] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3 (ipykernel)", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.9.13" - } - }, - "nbformat": 4, - "nbformat_minor": 5 -}