Eachan Johnson commited on
Commit
8430cde
·
1 Parent(s): 63c21fa

Add GH workflow

Browse files
Files changed (2) hide show
  1. app.py +5 -5
  2. workflows/hf-sync.yml +20 -0
app.py CHANGED
@@ -170,7 +170,7 @@ def plot_data_altair(
170
  encoding = dict(
171
  x=alt.X(year_col).scale(zero=False),
172
  y=alt.Y(y_col),
173
- color=alt.Color('count_type').title(""),
174
  )
175
  figure = alt.Chart(df_m).mark_circle().encode(**encoding, tooltip=[year_col, y_col])
176
  if params is not None:
@@ -241,13 +241,13 @@ def parameter_msg(*params) -> str:
241
  params = np.asarray([float(p) for p in params])
242
  pool_size, discovery_rate, discovery_lag, half_life = params
243
  return f"""
244
- {pool_size_title} | {pool_size:.1f} classes
245
 
246
- {discovery_rate_title} | {discovery_rate:.1f} / year
247
 
248
- **Discovery lag** | _time to maximal discovery rate_ | {discovery_lag:.1f} years
249
 
250
- {half_life_title} | {half_life:.1f} years
251
 
252
  """
253
 
 
170
  encoding = dict(
171
  x=alt.X(year_col).scale(zero=False),
172
  y=alt.Y(y_col),
173
+ color=alt.Color('count_type').title("").scale(range=colorblind_palette()),
174
  )
175
  figure = alt.Chart(df_m).mark_circle().encode(**encoding, tooltip=[year_col, y_col])
176
  if params is not None:
 
241
  params = np.asarray([float(p) for p in params])
242
  pool_size, discovery_rate, discovery_lag, half_life = params
243
  return f"""
244
+ {pool_size_title} | **{pool_size:.1f} classes**
245
 
246
+ {discovery_rate_title} | **{discovery_rate:.1f} / year**
247
 
248
+ **Discovery lag** | _time to maximal discovery rate_ | **{discovery_lag:.1f} years**
249
 
250
+ {half_life_title} | **{half_life:.1f} years**
251
 
252
  """
253
 
workflows/hf-sync.yml ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: Sync to Hugging Face hub
2
+ on:
3
+ push:
4
+ branches: [main]
5
+
6
+ # to run this workflow manually from the Actions tab
7
+ workflow_dispatch:
8
+
9
+ jobs:
10
+ sync-to-hub:
11
+ runs-on: ubuntu-latest
12
+ steps:
13
+ - uses: actions/checkout@v3
14
+ with:
15
+ fetch-depth: 0
16
+ lfs: true
17
+ - name: Push to hub
18
+ env:
19
+ HF_TOKEN: ${{ secrets.HF_TOKEN }}
20
+ run: git push https://HF_USERNAME:[email protected]/spaces/scbirlab/abx-discovery-resistance-dynamics main