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

fixing timestamp parsing #118

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
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
19 changes: 12 additions & 7 deletions caveclient/chunkedgraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,11 @@ def root_id_int_list_check(
root_id,
make_unique=False,
):
if isinstance(root_id, int) or isinstance(root_id, np.uint64) or isinstance(root_id, np.int64):
if (
isinstance(root_id, int)
or isinstance(root_id, np.uint64)
or isinstance(root_id, np.int64)
):
root_id = [root_id]
elif isinstance(root_id, str):
try:
Expand Down Expand Up @@ -332,10 +336,8 @@ def get_user_operations(
response = self.session.get(url, params=params)

d = handle_response(response)
df = pd.DataFrame(d)
df["timestamp"] = df["timestamp"].map(
lambda x: datetime.datetime.fromtimestamp(x / 1000, pytz.UTC)
)
df = pd.DataFrame(json.loads(d))
df['timestamp'] = df['timestamp'].apply(lambda x: datetime.datetime.fromtimestamp(x, tz=datetime.timezone.utc))
return df

def get_tabular_change_log(self, root_ids, filtered=True):
Expand Down Expand Up @@ -884,9 +886,12 @@ def suggest_latest_roots(

delta_layers = 4
if stop_layer is None:
stop_layer = self.segmentation_info.get("graph", {}).get("n_layers", 6) - delta_layers
stop_layer = (
self.segmentation_info.get("graph", {}).get("n_layers", 6)
- delta_layers
)
stop_layer = max(1, stop_layer)

chunks_orig = self.get_leaves(root_id, stop_layer=stop_layer)
chunk_list = np.array(
[
Expand Down