Skip to content

Commit

Permalink
Merge pull request #304 from MeteoSwiss/develop
Browse files Browse the repository at this point in the history
Change location of config files
  • Loading branch information
fpavogt authored Nov 28, 2024
2 parents aec7a46 + 92f7660 commit 338c92a
Show file tree
Hide file tree
Showing 26 changed files with 27 additions and 14 deletions.
12 changes: 9 additions & 3 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,15 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
### Removed:
### Security:

## [v1.2.1]
### Added:
### Fixed:
- [fpavogt, 28.11.2024] Fix #302 (change location of config files)
### Changed:
### Deprecated:
### Removed:
### Security:

## [v1.2.0]
### Added:
- [fpavogt, 18.11.2024] Add missing links to the docs
Expand All @@ -21,9 +30,6 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
### Changed:
- [fpavogt, 18.11.2024] Request Python <3.12 and numpy<2.0
- [fpavogt, 19.11.2024] Misc. docs updates
### Deprecated:
### Removed:
### Security:

## [v1.1.0]
### Added:
Expand Down
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ include README
include CHANGELOG
graft src/dvas/plots/mpl_styles
graft src/dvas_recipes/recipes
graft src/dvas_demo/config
graft src/dvas_recipes/configs
6 changes: 3 additions & 3 deletions docs/source/running_recipes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ Anatomy of the dvas processing arena

There are 3 main components to a dvas processing arena: the
:ref:`original data <original_data>`,
the :ref:`database config files <config_data>`,
the :ref:`database configs files <config_data>`,
and the :ref:`recipe file <recipe_file>`. Let's take a closer look at each of these.

.. _original_data:
Expand All @@ -88,8 +88,8 @@ metadata files - no need to change anything there.

.. _config_data:

The config folder
.................
The configs folder
..................

This folder contains all the information required to setup the dvas database, and have it ingest all
the original data correctly. Modifying these files is only required if one wishes to include
Expand Down
2 changes: 1 addition & 1 deletion src/dvas/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
"""

VERSION = '1.2.0'
VERSION = '1.2.1'
2 changes: 1 addition & 1 deletion src/dvas_demo/demo_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
# Init paths
# WARNING: to set an "absolute" path, make sure to preface it with "/", e.g.:
# path_var.orig_data_path = Path('/Users', 'jdoe', 'dvas_devdata')
path_var.config_dir_path = demo_file_path.parent / 'config'
path_var.config_dir_path = demo_file_path.parent / '..' / 'dvas_recipes' / 'configs'
path_var.orig_data_path = demo_file_path.parent / 'data'
path_var.local_db_path = demo_file_path.parent / 'db'
path_var.output_path = demo_file_path.parent / 'output'
Expand Down
File renamed without changes.
File renamed without changes.
7 changes: 3 additions & 4 deletions src/dvas_recipes/hl_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

# Import from dvas recipes
from .errors import DvasRecipesError
from .utils import default_arena_path, demo_storage_path, recipe_storage_path
from .utils import default_arena_path, configs_storage_path, recipe_storage_path
from .recipe import Recipe

# Setup the local logger
Expand Down Expand Up @@ -70,8 +70,7 @@ def init_arena(arena_path=None):
arena_path = Path(arena_path)

# Very well, setup the config files for the dvas database initialization
shutil.copytree(demo_storage_path(), arena_path,
ignore=shutil.ignore_patterns('db', 'output', 'data', '*.py'),
shutil.copytree(configs_storage_path(), arena_path / 'configs', ignore=None,
dirs_exist_ok=False)

# And also copy the dvas recipes, in case the user wants to use these
Expand Down Expand Up @@ -122,7 +121,7 @@ def optimize(n_cpus=None, prf_length=7001, chunk_min=50, chunk_max=300, n_chunk=

# Set the config file path, so that we can have a DB initialize with proper parameters.
# Point towards the core dvas file, so that this can be run from anywhere.
setattr(path_var, 'config_dir_path', demo_storage_path() / 'config')
setattr(path_var, 'config_dir_path', configs_storage_path())

# Actually create the database
db_mngr = DatabaseManager()
Expand Down
2 changes: 1 addition & 1 deletion src/dvas_recipes/recipes/uaii2022.rcp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ rcp_paths:
common_base: &common_base ./
config_dir_path:
base_path: *common_base
sub_path: config
sub_path: configs
orig_data_path:
base_path: *common_base
sub_path: ../import
Expand Down
8 changes: 8 additions & 0 deletions src/dvas_recipes/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@ def demo_storage_path():
return Path(__file__).resolve(strict=True).parent / '..' / 'dvas_demo'


def configs_storage_path():
""" Returns the absolute path to the stored dvas configs locations, from where the dvas default
config files can be copied locally.
"""
return Path(__file__).resolve(strict=True).parent / 'configs'


def recipe_storage_path():
""" Returns the absolute path to the stored dvas recipes location, from where they can be
copied locally.
Expand Down

0 comments on commit 338c92a

Please sign in to comment.