Spaces:
Sleeping

dn commited on
Commit
6e535ba
·
1 Parent(s): 795c958

clean up notebook

Browse files
Files changed (1) hide show
  1. notebooks/sb79map.py +10 -10
notebooks/sb79map.py CHANGED
@@ -45,8 +45,8 @@ def _():
45
 
46
  ## Overview of SB 79
47
  SB 79, a California bill promoting transit-oriented development, goes into effect in July 2026. By increasing
48
- allowable building heights and housing density within a half mile of qualifying transit stations, the law encourages
49
- more housing development near transit to reduce car dependency, congestion, and vehicle miles traveled.
50
  The two tables below summarize the qualifying transit stations and the new zoning under SB 79.
51
 
52
  #### Table 1: Tier designations
@@ -97,11 +97,11 @@ def _():
97
  @app.cell
98
  def _(file_input):
99
  mo.stop(not file_input.value)
100
- with tempfile.NamedTemporaryFile(delete=False) as tmp:
101
- tmp.write(file_input.value[0].contents)
102
- tmp.flush()
103
- print(tmp.name)
104
- new_stops = assign_tier_to_stops_from_gtfs(tmp.name)
105
  return (new_stops,)
106
 
107
 
@@ -171,8 +171,8 @@ def _(file_input, page, page_size):
171
  mo.stop(not file_input.value)
172
  start = page.value * page_size
173
  end = start + page_size
174
- mo.md("""Only showing a subset of 4000 parcels, but can paginate through to see all parcels.
175
- Calculations are done on all parcels. Grey parcels are ineligible for residential development.""")
176
  return end, start
177
 
178
 
@@ -184,7 +184,7 @@ def _(end, scag_parcels, start):
184
 
185
  @app.cell
186
  def _(new_stops, scag_parcels):
187
- with mo.status.spinner(title="Calculating dwelling units...") as _spinner:
188
  scag_with_density = compute_scag_density(scag_parcels=scag_parcels)
189
  scag_with_dwelling_units = compute_dwelling_units(stops_gdf=new_stops, scag_density=scag_with_density) # noqa: F841
190
  return (scag_with_dwelling_units,)
 
45
 
46
  ## Overview of SB 79
47
  SB 79, a California bill promoting transit-oriented development, goes into effect in July 2026. By increasing
48
+ housing density within a half mile of qualifying transit stations, the law encourages
49
+ more development near transit to reduce car dependency, congestion, and vehicle miles traveled.
50
  The two tables below summarize the qualifying transit stations and the new zoning under SB 79.
51
 
52
  #### Table 1: Tier designations
 
97
  @app.cell
98
  def _(file_input):
99
  mo.stop(not file_input.value)
100
+ with mo.status.spinner(title=f"Loading {file_input.value[0].name}...") as _spinner:
101
+ with tempfile.NamedTemporaryFile(delete=False) as tmp:
102
+ tmp.write(file_input.value[0].contents)
103
+ tmp.flush()
104
+ new_stops = assign_tier_to_stops_from_gtfs(tmp.name)
105
  return (new_stops,)
106
 
107
 
 
171
  mo.stop(not file_input.value)
172
  start = page.value * page_size
173
  end = start + page_size
174
+ mo.md("""Only showing a subset of 4000 parcels, use the slider above to see different parcel subsets.
175
+ Final calculations are done on all parcels. Grey parcels are ineligible for residential development.""")
176
  return end, start
177
 
178
 
 
184
 
185
  @app.cell
186
  def _(new_stops, scag_parcels):
187
+ with mo.status.spinner(title="Calculating housing density...") as _spinner:
188
  scag_with_density = compute_scag_density(scag_parcels=scag_parcels)
189
  scag_with_dwelling_units = compute_dwelling_units(stops_gdf=new_stops, scag_density=scag_with_density) # noqa: F841
190
  return (scag_with_dwelling_units,)