Skip to content

Commit

Permalink
Merge pull request #4 from eurec4a/lru_cache
Browse files Browse the repository at this point in the history
updates & cleanup
  • Loading branch information
d70-t authored Aug 10, 2023
2 parents d798095 + b75a5fb commit 6f8b9d3
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 24 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pythonpackage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
strategy:
max-parallel: 4
matrix:
python-version: [3.6, 3.7, 3.8, 3.9, "3.10"]
python-version: [3.7, 3.8, 3.9, "3.10", "3.11"]

steps:
- uses: actions/checkout@v1
Expand Down
9 changes: 0 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,6 @@ In [3]: flightinfo["HALO"]["HALO-0119"]["takeoff"]
Out[3]: datetime.datetime(2020, 1, 19, 9, 34, 25)
```

### obtaining general campaign metadata

```ipython
In [4]: meta = eurec4a.get_meta()
In [5]: meta["ATR42"]["color"]
Out[5]: '#f7c96b'
```

### accessing public datasets via the intake data catalog

```ipython
Expand Down
11 changes: 2 additions & 9 deletions eurec4a/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@


class GithubApi:
@lru_cache()
def get(self, endpoint):
url = "https://api.github.com/" + endpoint
return requests.get(url,
Expand All @@ -22,6 +23,7 @@ def get(self, endpoint):
github = GithubApi()


@lru_cache()
def get_flight_segments(version="latest"):
"""
Download and parse flight segmentation information.
Expand All @@ -40,15 +42,6 @@ def get_flight_segments(version="latest"):
return yaml.load(requests.get(all_flights_url).content, Loader=yaml.SafeLoader)


def get_meta():
"""
Download and parse general campaign metadata.
This includes information about platforms, instruments, people, data access etc.
"""
return yaml.load(requests.get("https://eurec4a_staging.pages.gwdg.de/eurec4a_meta/meta.yaml").content,
Loader=yaml.SafeLoader)


@lru_cache()
def get_cids():
return requests.get("https://raw.githubusercontent.com/eurec4a/ipfs_tools/main/cids.json").json()
Expand Down
5 changes: 0 additions & 5 deletions test/test_metadata_availability.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,6 @@ def test_flight_segment_availability_by_version():
assert "HALO" in segments


def test_meta_availability():
meta = eurec4a.get_meta()
assert "HALO" in meta


def test_inake_catalog_availability():
cat = eurec4a.get_intake_catalog()
assert "barbados" in cat
Expand Down

0 comments on commit 6f8b9d3

Please sign in to comment.