Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc20d645

Browse files
authored
Merge pull request#77 from ivelin/fix/minor-fixes
fix: revert data upload to tgz. Hitting API limit with parquet files.
2 parents131ee3b +f10a297 commitc20d645

File tree

2 files changed

+30
-12
lines changed

2 files changed

+30
-12
lines changed

‎src/canswim/hfhub.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -168,11 +168,11 @@ def download_data(self, repo_id: str = None, local_dir: str = None):
168168
token=self.HF_TOKEN,
169169
)
170170
# Unpack forecast parquet files from tar
171-
#forecast_dir = f"{data_dir}/forecast/"
172-
#forecast_tar = f"{data_dir}/forecast.tar.gz"
173-
#with tarfile.open(forecast_tar, "r:gz") as tar:
174-
# logger.info(f"Extracting {forecast_tar} to folder {forecast_dir}")
175-
# tar.extractall(path=forecast_dir, filter="data")
171+
forecast_dir=f"{data_dir}/forecast/"
172+
forecast_tar=f"{data_dir}/forecast.tar.gz"
173+
withtarfile.open(forecast_tar,"r:gz")astar:
174+
logger.info(f"Extracting{forecast_tar} to folder{forecast_dir}")
175+
tar.extractall(path=forecast_dir,filter="data")
176176

177177
defupload_data(
178178
self,repo_id:str=None,private:bool=True,local_dir:str=None
@@ -204,10 +204,10 @@ def upload_data(
204204
)
205205
# Compress forecast parquet files to pass hfhub limitation of 25k LFS files
206206
forecast_dir=f"{data_dir}/forecast/"
207-
#forecast_tar = f"{data_dir}/forecast.tar.gz"
208-
#with tarfile.open(forecast_tar, "w:gz") as tar:
209-
# logger.info(f"Creating {forecast_tar} from folder {forecast_dir}")
210-
# tar.add(forecast_dir, arcname=os.path.basename(forecast_dir))
207+
forecast_tar=f"{data_dir}/forecast.tar.gz"
208+
withtarfile.open(forecast_tar,"w:gz")astar:
209+
logger.info(f"Creating{forecast_tar} from folder{forecast_dir}")
210+
tar.add(forecast_dir,arcname=os.path.basename(forecast_dir))
211211
# upload select files to hfhub
212212
logger.info(f"uploading folder{data_dir}")
213213
upload_folder(

‎weekend.sh

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,29 @@
11
#!/usr/bin/bash
2+
#args=("$@")
3+
4+
# This script is intended to be executed by cron each weekend.
5+
# The goal is to pull latest market data for the week
6+
# and run forecast for the following week.
27

38
# stop on first error
4-
set -e
9+
# print verbose messages
10+
set -ex
11+
12+
echo"CANSWIM Weekend Forecast Routine: Starting..."
13+
14+
conda activate canswim
15+
pip install -e ./
16+
17+
#python -m canswim "${args[@]}"
18+
19+
python -m canswim
520

621
# gather up to date market data
7-
./canswim gatherdata
22+
##./canswim.sh gatherdata
823

924
# run forecast and upload to hf hub
10-
./canswim forecast
25+
##./canswim.sh forecast
26+
27+
echo"CANSWIM Weekend Forecast Routine: Finished."
28+
1129

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp