Skip to content
New issue

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

Release/v0.10.0 #598

Merged
merged 34 commits into from
May 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
431ec33
adding AzureStorageClient
brimoor Mar 20, 2023
791083b
adding to_account_url util
brimoor Mar 20, 2023
d31f454
typo
brimoor Mar 20, 2023
4ef5985
tweaks
brimoor Mar 20, 2023
8acd114
don't raise on EOPNOTSUPP
sashankaryal Mar 23, 2023
b967f0e
Merge pull request #589 from voxel51/bug/get-terminal-size-exception
sashankaryal Mar 24, 2023
4194735
upgrades
brimoor Mar 24, 2023
d5c896e
respecting alias when listing Azure files
brimoor Mar 24, 2023
9506235
handle conn_str
brimoor Mar 24, 2023
24d2f28
bumping version number
brimoor Mar 24, 2023
5d4948d
swapped ndjson for jsonlines
nebulae Mar 28, 2023
2a599ca
cleanup
nebulae Mar 29, 2023
099abcd
replace patool with rarfile and py7zr
nebulae Mar 30, 2023
fee0fbe
reverting version bump
brimoor Mar 31, 2023
03c882e
Merge pull request #588 from voxel51/azure
brimoor Mar 31, 2023
4e54d0e
updating requirements to reflect Python 3.6 min requirement
brimoor Mar 31, 2023
109acd6
use context managers
brimoor Mar 31, 2023
df7b107
explicitly state what formats we support
brimoor Mar 31, 2023
4a3472b
Merge pull request #590 from voxel51/feature/TEAMS-1071-replace-glp-code
brimoor Mar 31, 2023
e7cf5f3
bumping version number
brimoor Mar 31, 2023
9908980
removing ndjson mention
brimoor Mar 31, 2023
fcb2274
adding client env vars for Azure
brimoor Mar 31, 2023
1b0bed7
Merge branch 'develop' into release/v0.8.5
brimoor Mar 31, 2023
111f4b7
bump workflow ubuntu
benjaminpkane Apr 3, 2023
2f42b26
Merge pull request #591 from voxel51/release/v0.8.5
brimoor Apr 3, 2023
a1f3be7
bumping version number
brimoor Apr 3, 2023
b5629f2
Merge pull request #592 from voxel51/release/v0.9.0
brimoor Apr 5, 2023
5892e3c
Remove pkg_resources, use importlib metadata instead
ClementPinard Apr 26, 2023
8c291da
Merge pull request #594 from ClementPinard/use_importlib
brimoor Apr 26, 2023
fae5987
cleanup
brimoor Apr 26, 2023
51395c5
bumping to 1.4.0
brimoor May 1, 2023
83d346d
generate signing credentials via IDTokenCredentials when using defaul…
brimoor May 2, 2023
1e63380
Merge pull request #595 from voxel51/feature/gcp-default-credentials
brimoor May 10, 2023
4a01595
bump version for release
findtopher May 11, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:

jobs:
publish:
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04
steps:
- name: Clone ETA
uses: actions/checkout@v2
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
**/*.md5
*.log
**/*.log
.idea

__pycache__
*.py[cod]
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ infrastructure.**
ETA is very portable:

- Installable on Mac or Linux
- Supports Python 2.7 and Python 3.6 or later
- Supports Python 3.6 or later
- Supports TensorFlow 1.X and 2.X
- Supports OpenCV 2.4+ and OpenCV 3.0+
- Supports CPU-only and GPU-enabled installations
Expand Down
29 changes: 18 additions & 11 deletions eta/core/serial.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
from uuid import uuid4
import zlib

import ndjson
import jsonlines
import numpy as np

import eta.core.utils as etau
Expand Down Expand Up @@ -134,16 +134,16 @@ def read_ndjson(path):
Returns:
a list of JSON dicts
"""
with open(path, "rt") as f:
return ndjson.load(f)
with jsonlines.open(path) as r:
return list(r.iter(skip_empty=True))


def load_ndjson(path_or_str):
"""Loads NDJSON from the input argument.

The input argument can be any of the following:
(a) the path to a NDJSON file on disk
(b) a string that can be directly parsed via `ndjson.loads`
(b) an NDJSON string or bytes

Args:
path_or_str: the NDJSON path or string
Expand All @@ -162,10 +162,13 @@ def load_ndjson(path_or_str):

def _load_ndjson(str_or_bytes):
try:
return ndjson.loads(str_or_bytes)
except TypeError:
# Must be a Python version for which ndjson.loads() cannot handle bytes
return ndjson.loads(str_or_bytes.decode("utf-8"))
ndjson_str = str_or_bytes.decode("utf-8")
except AttributeError:
ndjson_str = str_or_bytes

with io.StringIO(ndjson_str) as f:
with jsonlines.Reader(f) as r:
return list(r.iter(skip_empty=True))


def write_ndjson(obj, path, append=False):
Expand All @@ -185,7 +188,11 @@ def write_ndjson(obj, path, append=False):

mode = "at" if append else "wt"
with open(path, mode) as f:
f.write(prefix + ndjson.dumps(obj))
if prefix:
f.write(prefix)

with jsonlines.Writer(f) as w:
w.write_all(obj)


def json_to_str(obj, pretty_print=True):
Expand Down Expand Up @@ -1142,8 +1149,8 @@ def add_by_path(self, path):
def add_iterable(self, elements):
"""Adds the elements in the given iterable to the Big iterable.

Args:
elements: an iterable of elements
Args:
elements: an iterable of elements
"""
raise NotImplementedError("subclasses must implement add_iterable()")

Expand Down
Loading