We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ece2cmor constructs the paths for the bathymetry and subbasins files (if not given as env vars) as follows:
expdir = os.path.abspath(os.path.join(os.path.realpath(path), "..", "..", "..")) # [...] bathy_file_ = os.environ.get("ECE2CMOR3_NEMO_BATHY_METER", os.path.join(expdir, "bathy_meter.nc")) # [...] basin_file_ = os.environ.get("ECE2CMOR3_NEMO_SUBBASINS", os.path.join(expdir, "subbasins.nc"))
The problem is that this does not necessarily works if symbolic links are involved. Consider the following structure:
> tree . . ├── bar └── foo ├── bar -> ../bar └── file 3 directories, 1 file
So ./foo/bar is a symbolic link to ./bar. Then we have
./foo/bar
./bar
> ls foo/file foo/file
but
> ls foo/bar/../file ls: cannot access 'foo/bar/../file': No such file or directory
I had a corresponding situation in our linked-up rundirs and cmorisation dropped some Ofx variables as a consequence.
Ofx
It might be a better implementation to use the Python pathlib to construct the paths with something like this (not tested!):
pathlib
from pathlib import Path expdir = Path(path).parents[3] bathy_file_ = expdir / 'bathy_meter.nc' basin_file_ = expdir / 'subbasins.nc'
The text was updated successfully, but these errors were encountered:
No branches or pull requests
ece2cmor constructs the paths for the bathymetry and subbasins files (if not given as env vars) as follows:
The problem is that this does not necessarily works if symbolic links are involved. Consider the following structure:
So
./foo/bar
is a symbolic link to./bar
. Then we havebut
I had a corresponding situation in our linked-up rundirs and cmorisation dropped some
Ofx
variables as a consequence.It might be a better implementation to use the Python
pathlib
to construct the paths with something like this (not tested!):The text was updated successfully, but these errors were encountered: