cdsapi icon indicating copy to clipboard operation
cdsapi copied to clipboard

COPDS-1531: beta api

Open malmans2 opened this issue 4 months ago • 3 comments

malmans2 avatar Feb 29 '24 15:02 malmans2

Overall the pull requests can be approved after changing or removing the url and token. If the integration test is needed it should use a GitHub secret

Done. The new test checks whether the class is properly instantiated, so no secret is needed.

malmans2 avatar Feb 29 '24 17:02 malmans2

Going from old api to new api we need the possibility to create integration tests. Several keyword arguments of the current client are not implemented in the new version. Some of those are essential for producing tests suites, like retry_max. Please implement it asap.

gbiavati avatar Mar 05 '24 10:03 gbiavati

Hi @gbiavati,

I can not reproduce the installation issue you reported last night.

Going from old api to new api we need the possibility to create integration tests. Several keyword arguments of the current client are not implemented in the new version. Some of those are essential for producing tests suites, like retry_max. Please implement it asap.

retry_max, sleep_max, and timeout are implemented in cads-api-client==0.8.2

Here is a minimal snippet to install the latest versions and download a dummy file.

conda create -n test-cdsapi-beta -c conda-forge pip --yes
conda activate test-cdsapi-beta
pip install git+https://github.com/bopen/cdsapi.git@COPDS-1531-beta-api
export CDSAPI_RC=$HOME/.cadsapirc
python -c "import cdsapi; client = cdsapi.Client(sleep_max=120, retry_max=500, timeout=60); client.retrieve('test-adaptor-dummy', {}, 'test.grib')"

malmans2 avatar Mar 06 '24 14:03 malmans2

Hi @malmans2 , The installation of this api using pip may produce different results if a user has a clean environment or an existing installation of the cdsapi. One reason can be the version defined in https://github.com/ecmwf/cdsapi/blob/cf606f9dd78e71690b1fb406b638ced26598c301/setup.py#L33

it is the same of the current api, so it would not override/update normally.

This package is meant to facilitate the migration to the new system, so its installation and usage should be tested more as an upgrade of existing environment, not as a fresh install

gbiavati avatar Apr 18 '24 09:04 gbiavati

Hi @gbiavati,

As cdsapi does not infer the version from git tags, I believe that the hardcoded variable version is manually updated by cdsapi maintainers when they issue a new release. Therefore, when this PR will be merged and a new release will be issued, users will be able to easily upgrade to the latest version with one of the following commands:

pip install --upgrade cdsapi
conda update -c conda-forge cdsapi

We added all dependencies in both cdsapi and cads-api-client, so users can just upgrade cdsapi without having to install any additional dependency. See:

  • https://github.com/bopen/cdsapi/blob/4d33abcd08d8676512340a9d1dab76ff8172fefb/setup.py#L48
  • https://github.com/ecmwf-projects/cads-api-client/blob/80e38ce8ac8eb92e529772c1ac0f03c9b63de246/pyproject.toml#L18

malmans2 avatar Apr 18 '24 09:04 malmans2

If you need to install this PR in an existing environment, this command worked fine for me:

pip install --upgrade --force-reinstall git+https://github.com/bopen/cdsapi.git@COPDS-1531-beta-api

malmans2 avatar Apr 18 '24 09:04 malmans2