Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

conf.py 1.1 KB

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
  1. """
  2. Define paths to all DVC dependency and output files.
  3. """
  4. from pathlib import Path
  5. from urllib.parse import urlparse
  6. from dvc.repo import Repo
  7. dvc_repo = Repo('.')
  8. # Get DVC remote URL to your remote work directory for this project
  9. remote_user_work_path = urlparse(
  10. dvc_repo.config.config[f'remote "ahsoka_user_workspace"']['url']).path
  11. remote_user_work_path = Path(remote_user_work_path)
  12. remote_project_work_path = urlparse(
  13. dvc_repo.config.config[f'remote "ahsoka_project_data"']['url']).path
  14. remote_project_work_folder_name = Path(remote_project_work_path).name
  15. remote_work_path = remote_user_work_path/remote_project_work_folder_name
  16. # Get DVC remote URL to the project cache
  17. remote_cache_path = urlparse(
  18. dvc_repo.config.config[f'remote "ahsoka_project_cache"']['url']).path
  19. remote_cache_path = Path(remote_cache_path)
  20. assert remote_work_path.name == remote_cache_path.name, (
  21. 'The name of your remote DVC data directory for this project:'
  22. f'"{remote_work_path.name}", is should be the same as the same as the name'
  23. f'of the project cache directory: "{remote_cache_path.name}')
  24. data_dir = remote_work_path
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...