Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pytrxmat
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Nyx
pytrxmat
Commits
850c0947
Commit
850c0947
authored
10 months ago
by
Alexandre BLANC
Browse files
Options
Downloads
Patches
Plain Diff
ADD int int temporal slicing to trx
parent
b998823b
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/pytrxmat/trx.py
+4
-1
4 additions, 1 deletion
src/pytrxmat/trx.py
with
4 additions
and
1 deletion
src/pytrxmat/trx.py
+
4
−
1
View file @
850c0947
...
...
@@ -107,6 +107,7 @@ class TRX:
* tuple(float, float) : return all times t_sel such that t[0] <= t_sel < t[1].
* tuple(float, int) : return up to t[1] points after the intial time t[0].
* tuple(int, float) : return up to t[0] points before the finalal time t[1].
* tuple(int, int) : slice the time axis along t[0]:t[1].
There is no guarantee that the shapes are the same across larvae due to missing data.
If no points verify the condition, returns an array whith second dimension equal to 0.
...
...
@@ -159,8 +160,10 @@ class TRX:
arrays
=
[
a
[:,
s
:
s
+
t2
]
if
s
is
not
None
else
np
.
empty
((
a
.
shape
[
0
],
0
))
for
a
,
s
in
zip
(
arrays
,
start_points
)]
elif
isinstance
(
t1
,
int
)
and
isinstance
(
t2
,
float
):
raise
NotImplementedError
()
elif
isinstance
(
t1
,
int
)
and
isinstance
(
t2
,
int
):
arrays
=
[
a
[:,
t1
:
t2
]
for
a
in
arrays
]
else
:
raise
ValueError
(
"'
t
'
can only be of type Tuple(float, float), Tuple(float, int), or Tuple(int, float)
"
)
raise
ValueError
(
"'
t
'
can only be of type Tuple(float, float), Tuple(float, int),
Tuple(int, int),
or Tuple(int, float)
"
)
if
'
return_columns
'
in
kwargs
and
kwargs
[
'
return_columns
'
]:
return
arrays
,
columns
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment