{"id":38517847,"url":"https://github.com/digitalgeographylab/maphel-langtime","last_synced_at":"2026-01-17T06:34:32.073Z","repository":{"id":197229483,"uuid":"654924066","full_name":"DigitalGeographyLab/maphel-langtime","owner":"DigitalGeographyLab","description":"This repository holds the Python scripts used in the research article (https://doi.org/10.1002/psp.2717) published in Population, Space and Place ","archived":false,"fork":false,"pushed_at":"2023-11-02T11:35:00.000Z","size":45,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-01-26T04:38:10.622Z","etag":null,"topics":["geography","python","spatial-analysis"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DigitalGeographyLab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-06-17T10:48:31.000Z","updated_at":"2023-10-13T17:53:59.000Z","dependencies_parsed_at":"2023-11-20T20:03:59.671Z","dependency_job_id":null,"html_url":"https://github.com/DigitalGeographyLab/maphel-langtime","commit_stats":{"total_commits":5,"total_committers":2,"mean_commits":2.5,"dds":0.4,"last_synced_commit":"990235074266dfeebc0e37599d473398771b2ced"},"previous_names":["digitalgeographylab/maphel-langtime"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/DigitalGeographyLab/maphel-langtime","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DigitalGeographyLab%2Fmaphel-langtime","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DigitalGeographyLab%2Fmaphel-langtime/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DigitalGeographyLab%2Fmaphel-langtime/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DigitalGeographyLab%2Fmaphel-langtime/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DigitalGeographyLab","download_url":"https://codeload.github.com/DigitalGeographyLab/maphel-langtime/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DigitalGeographyLab%2Fmaphel-langtime/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28502444,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T04:31:57.058Z","status":"ssl_error","status_checked_at":"2026-01-17T04:31:45.816Z","response_time":85,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["geography","python","spatial-analysis"],"created_at":"2026-01-17T06:34:31.408Z","updated_at":"2026-01-17T06:34:32.050Z","avatar_url":"https://github.com/DigitalGeographyLab.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"### Information\n\nThis repo is for Python scripts for *\"Capturing urban diversity through languages: long-term changes in multilingual residential neighbourhoods in the Helsinki Metropolitan Area\"* published in [Population, Space and Place](https://doi.org/10.1002/psp.2717).\n\n### Pre-analysis steps\n\n* Apply for access to individual-level register data of [Statistics Finland](https://www.stat.fi/tup/tutkijapalvelut/fiona-etakayttojarjestelma_en.html)\n* Calculate linguistic diversity of register data per grid cell with [scikit-bio]() similar to how it was done in [a previous article](https://github.com/DigitalGeographyLab/maphel-urbanlingdiv/blob/main/preprocessing/neighborhood_diversities.py) or with language family information in this article's appendices with [calculate_langfam_diversity.py](calculate_langfam_diversity.py).\n\n### Suggested running order of scripts\n\n| Step | Script | Description | Input | Output |\n| ---- | :----- | :---------- | :---- | :----- |\n| 1 | [calculate_langfam_diversity.py](calculate_langfam_diversity.py) | Calculates diversity of language families per grid cell | Output from Step 1 | Geopackages |\n| 2 | [add_langfam_genus.py](add_langfam_genus.py) | Adds information on the family and genus per each language | First language information per individual in a CSV file | Language family and genus information per individual |\n| 3 | [calculate_speakers.py](calculate_speakers.py) | Calculates the number of speakers per a grid cell across the language groups used in the article | First language information per individual in a CSV file | Geopackage |\n| 4 | [calculate_language_changes.py](calculate_language_changes.py) | Calculates how many times individuals have changed their language | First language information per individual in a CSV file | Pickled dataframe on changes |\n| 5 | [HMA_overall_diversityplot.py](HMA_overall_diversityplot.py) | Plots subplots in Figure 1 and full Figure 2 | Individual-level data from Statistics Finland | PDF Figures |\n| 6 | [get_gridcell_histories.py](get_gridcell_histories.py) | Gets annual linguistic diversity values per grid cell | Geopackage of diversity information per grid cell | Geopackage of metric-specific grid cell histories |\n| 7 | [calculate_livingspace_commutes.py](calculate_livingspace_commutes.py) | Aggregates the records on living space and commute distances to grid cells | FOLK commuting and employment statistics | Pickled data frame |\n| 8 | [add_livingspace_commute_to_HMAgrid.py](add_livingspace_commute_to_HMAgrid.py) | Adds the calculated values from Step 5 to the spatial grid data | Step 5 | Geopackage |\n| 9 | [plot_diversities_in_new_old_stable_grids.py](plot_diversities_in_new_old_stable_grids.py) | Provides non-normalized plots for Figure 5 | Output from step 4 | PDF Graph and pickled dataframes |\n| 10 | [norm_grid_trajectories.py](norm_grid_trajectories.py) | Calculates the normalized values of grid trajectories | Geopackage of diversity information per grid cell | PDF Graphs and pickled dataframes |\n| 11 | [popweigh_grid_trajectories.py](popweigh_grid_trajectories.py) | Calculates the population-weighted average values of grid trajectories | Geopackage of diversity information per grid cell | PDF Graphs and pickled dataframes |\n| 12 | [plot_grid_diversitiyes_figure5.py](plot_grid_diversitiyes_figure5.py) | Plots final Figure 5 | Outputs from steps 8 and 9 | PDF Graph |\n| 13 | [plot_divs_est_som_87-19.py](plot_divs_est_som_87-19.py) | Plots figures 9 and 10, yields outputs | Output from Step 1 | Figures 9 and 10, dataframes |\n| 14 | [plot_weighted_divs_est_som_87-19.py](plot_weighted_divs_est_som_87-19.py) | Plots Figure 4 | Output from Step 2| Geopackage with stability classficiations |\n| 15 | [calculate_spatial_markov.py](calculate_spatial_markov.py) | Calculate and plot Markov chain matrices | Output from Step 5 | PDF matrices (Figure 6) and matrices as pickled dataframes |\n| 16 | [compare_markov.py](compare_markov.py) | Compares Markov probability matrices with Jensen-Shannon distances | Outputs Figure 7 | PNG file |\n\n### Other information\nSome of these scripts have not been formatted to be flexibly used on all computers. You might have to alter some hard-coded filepaths.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdigitalgeographylab%2Fmaphel-langtime","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdigitalgeographylab%2Fmaphel-langtime","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdigitalgeographylab%2Fmaphel-langtime/lists"}