Giter VIP home page Giter VIP logo

munch's People

Contributors

bisaloo avatar indrajeetpatil avatar krlmlr avatar maelle avatar thomasknecht avatar tschiefer avatar wael-sadek avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

munch's Issues

Sub-year precision?

Was possible in the original code, we should be able to adapt here. Leads to somewhat more matching tables.

Check completeness of mapping tables

  • Set of source municipalities identical for all source years
  • Set of target municipalities identical for all target years

We're looking only for internal consistency here -- within the mapping tables. Consistency with external data is important too, but a different issue.

Sub-year precision

We should strive towards working with the dates as provided by the data, and not combine to years. (I remember adding an issue but can't find it now.)

write_all_mapping_tables() potentially writes mapping table 1 year into the future

write_all_mapping_tables() determines the latest target year by:

MAX_YEAR <- lubridate::year(
    max(swc_get_municipality_mutations()$mAbolitionDate, na.rm = TRUE)
  ) + 1L

which means in case the last abolition happened during the current year, the target year will be 1 year in the future.

I would suggest

lubridate::year(
    max(swc_get_municipality_mutations()$mAdmissionDate, na.rm = TRUE)
)

Add function: get_mun_in_year(year)

Gets the municipalities-inventory of a certain year.

Discussion:

  • should it be delivered with the SwissHistMunData package or is it calculated on-the-fly?

Fix CI/CD

I changed cantons to get_cantons(), need to clean up.

Automation

  • New pull request when data changes, see upgrade.yaml in RSQLite
  • Update data page automatically (doesn't happen now for some reason)
  • Data page should link to files directly on GitHub, requires #22

Compute lookup tables in main branch

in inst directory, recreated by the pkgdown.yaml workflow. The data.Rmd vignette should link to those files.

Rationale: putting stuff into ../docs no longer works when rendering a pkgdown vignette.

what do do with special areas?

As it turns out, our mapping tables include the only land-area which is not part of a municipality ("Staatswald Galm", BFSNr: 2391) and five "Kommunanzen", which belong to more than one municipality. Two of the latter still exist.
I don't think that's necessarily wrong, it's just something to be aware of.
Possibly we should mention it in the documentation.

E.g. in the downloaded BFS data (load_bfs_mun_list()) these areas do not appear among the municipalities.

More details in https://github.com/cynkra/munch/blob/f-31-tests/tests/testthat/test-external-consistency.R

Internal API to conveniently access from with in R

  • The data should be on GitHub, but not part of the repository
  • A function should load the data into a cache or update an existing cache, with user consent (cf. renv::consent())
  • If no consent given -- no caching, only in temporary directory
  • We can perhaps use httr::HEAD() to check if the cache is up to date

Tests

Let's start with a few known output tests for select municipalities, and also error behavior.

Avoid bundling data

Read from GitHub and cache locally, update on demand, issue a HEAD() request to check if data has changed.

Running `swc_get_mun_merges()` into the console does not return any output

Running swc_get_mun_merges(2019, canton = "AG") into the console does not return a data.frame or a tibble, conversely to what happens with:

  • tibble::as_tibble(swc_get_mun_merges(2019, canton = "AG"))
  • as.data.frame(swc_get_mun_merges(2019, canton = "AG"))

This behaviour is not aligned with those provided by other functions, such as swc_get_mutations() or swc_get_merger_mapping_table()

Add Tobias as contributor

Can we add Tobias as contributor since we want to work together on this project, or should we fork the repo?

Documentation

is rather terse right now, we need much more. With examples and perhaps a walkthrough.

Rename to munch

  • Replace everywhere
  • GitHub homepage
  • Create stub for old pkgdown content
  • Replace swc_() prefix
  • Clean up README

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.