Skip to content

Commit

Permalink
Merge branch 'master' into 44-edit-dvcyaml-to-include-files-invoked-a…
Browse files Browse the repository at this point in the history
…s-deps
  • Loading branch information
dfsnow authored Aug 14, 2024
2 parents e0bb0b2 + 2a066b5 commit 003e98d
Show file tree
Hide file tree
Showing 8 changed files with 350 additions and 356 deletions.
28 changes: 3 additions & 25 deletions .github/workflows/pre-commit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,29 +10,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup python
uses: actions/setup-python@v4
with:
python-version: 3.x

- name: Install pre-commit
run: python -m pip install pre-commit
shell: bash

- name: Freeze dependencies
run: python -m pip freeze --local
shell: bash

- name: Cache pre-commit environment
uses: actions/cache@v3
with:
path: |
~/.cache/pre-commit
~/.cache/R
key: pre-commit-3-${{ env.pythonLocation }}-${{ hashFiles('.pre-commit-config.yaml') }}

- name: Run pre-commit
run: pre-commit run --show-diff-on-failure --color=always --all-files
shell: bash
- name: Run pre-commit checks
uses: ccao-data/actions/pre-commit@main
5 changes: 3 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
# R specific hooks: https://github.com/lorenzwalthert/precommit
repos:
- repo: https://github.com/lorenzwalthert/precommit
rev: v0.3.2.9027
rev: v0.4.2
hooks:
- id: style-files
args: [--style_pkg=styler, --style_fun=tidyverse_style]
require_serial: true
- id: lintr
- id: readme-rmd-rendered
exclude: reports/README.md
Expand All @@ -25,4 +26,4 @@ repos:
name: Don't commit common R artifacts
entry: Cannot commit .Rhistory, .RData, .Rds or .rds.
language: fail
files: '\.(Rhistory|RData|Rds|rds)$'
files: '\.(Rhistory|RData|Rds|rds)$'
4 changes: 0 additions & 4 deletions params.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -337,10 +337,6 @@ model:

# Parameters used in the assess stage to finalize the intial model predictions
pv:
# For nonlivable units, anything below this value gets the same value as the
# prior year
nonlivable_threshold: 1000

# Cap the proportion of the PIN's total value dedicated to land. This is
# necessary since sometimes the model provides low predictions relative to the
# land rates created by Valuations
Expand Down
12 changes: 1 addition & 11 deletions pipeline/02-assess.R
Original file line number Diff line number Diff line change
Expand Up @@ -105,17 +105,7 @@ assessment_data_bldg <- assessment_data_pred %>%
na.rm = TRUE
),
pred_pin_final_fmv = bldg_total_value_livable *
(adj_pro_rate / bldg_total_proration_rate_livable),
# For certain units (common areas), we want to have a consistent low value
# across time (usually $10)
pred_pin_final_fmv = case_when(
meta_modeling_group == "NONLIVABLE" &
(meta_mailed_tot * 10) <= params$pv$nonlivable_threshold ~
meta_mailed_tot * 10,
meta_modeling_group == "NONLIVABLE" &
is.na(meta_mailed_tot) ~ 10,
TRUE ~ pred_pin_final_fmv
)
(adj_pro_rate / bldg_total_proration_rate_livable)
) %>%
ungroup()

Expand Down
1 change: 0 additions & 1 deletion pipeline/05-finalize.R
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ metadata <- tibble::tibble(
cv_no_improve = params$cv$no_improve,
cv_split_prop = params$cv$split_prop,
cv_best_metric = params$cv$best_metric,
pv_nonlivable_threshold = params$pv$nonlivable_threshold,
pv_land_pct_of_total_cap = params$pv$land_pct_of_total_cap,
pv_round_break = list(params$pv$round_break),
pv_round_to_nearest = list(params$pv$round_to_nearest),
Expand Down
5 changes: 0 additions & 5 deletions pipeline/07-export.R
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,6 @@ assessment_pin_prepped <- assessment_pin %>%
", ", loc_property_zip
),
meta_pin10 = str_sub(meta_pin, 1, 10),
flag_common_area = replace_na(
as.logical(as.numeric(flag_prior_near_to_pred_unchanged)) &
prior_near_tot <= params$pv$nonlivable_threshold,
0
),
across(
ends_with("added_later") & where(is.logical),
~ as.numeric(.x)
Expand Down
10 changes: 5 additions & 5 deletions renv.lock
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"R": {
"Version": "4.3.2",
"Version": "4.4.0",
"Repositories": [
{
"Name": "CRAN",
"URL": "https://cran.rstudio.com"
"URL": "https://cloud.r-project.org"
}
]
},
Expand Down Expand Up @@ -1265,13 +1265,13 @@
},
"renv": {
"Package": "renv",
"Version": "1.0.3",
"Version": "1.0.7",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
"utils"
],
"Hash": "41b847654f567341725473431dd0d5ab"
"Hash": "397b7b2a265bc5a7a06852524dabae20"
},
"rlang": {
"Package": "rlang",
Expand Down Expand Up @@ -1705,4 +1705,4 @@
"Hash": "d98c94dacb7e0efcf83b0a133a705504"
}
}
}
}
Loading

0 comments on commit 003e98d

Please sign in to comment.