Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
K
klaus_wendelin
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Eteri
klaus_wendelin
Commits
b82cbfee
Commit
b82cbfee
authored
Feb 20, 2020
by
Klaus Wölfel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wendelin: add setArrayDtypeNames so that names can be changed from sandbox
parent
218c94e6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
7 deletions
+12
-7
bt5/erp5_wendelin/DocumentTemplateItem/portal_components/document.erp5.DataArray.py
...TemplateItem/portal_components/document.erp5.DataArray.py
+9
-3
bt5/erp5_wendelin/DocumentTemplateItem/portal_components/document.erp5.DataArray.xml
...emplateItem/portal_components/document.erp5.DataArray.xml
+3
-4
No files found.
bt5/erp5_wendelin/DocumentTemplateItem/portal_components/document.erp5.DataArray.py
View file @
b82cbfee
...
...
@@ -114,14 +114,14 @@ class DataArray(BigFile):
Get numpy array shape
"""
return
self
.
getArray
().
shape
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'getArrayDtype'
)
def
getArrayDtype
(
self
):
"""
Get numpy array dtype
"""
return
self
.
getArray
().
dtype
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'getArrayDtypeNames'
)
def
getArrayDtypeNames
(
self
):
"""
...
...
@@ -129,6 +129,13 @@ class DataArray(BigFile):
"""
return
self
.
getArray
().
dtype
.
names
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'setArrayDtypeNames'
)
def
setArrayDtypeNames
(
self
,
names
):
"""
Set numpy array dtype names
"""
self
.
getArray
().
dtype
.
names
=
names
security
.
declareProtected
(
Permissions
.
View
,
'index_html'
)
def
index_html
(
self
,
REQUEST
,
RESPONSE
,
format
=
_MARKER
,
inline
=
_MARKER
,
**
kw
):
"""
...
...
@@ -160,7 +167,6 @@ class DataArray(BigFile):
index
.
get
(
'step'
)))
elif
start_date
is
not
None
and
stop_date
is
not
None
:
import
numpy
as
np
import
pandas
as
pd
start_date_vector
=
self
.
getArray
()[:][
'start_date'
]
stop_date_vector
=
self
.
getArray
()[:][
'stop_date'
]
valid_start_idx
=
np
.
where
(
start_date_vector
>=
np
.
datetime64
(
start_date
))[
0
]
...
...
bt5/erp5_wendelin/DocumentTemplateItem/portal_components/document.erp5.DataArray.xml
View file @
b82cbfee
...
...
@@ -46,10 +46,9 @@
<key>
<string>
text_content_warning_message
</string>
</key>
<value>
<tuple>
<string>
W:133, 42: Redefining built-in \'format\' (redefined-builtin)
</string>
<string>
W:183, 4: Redefining built-in \'range\' (redefined-builtin)
</string>
<string>
W:210, 10: No exception type(s) specified (bare-except)
</string>
<string>
W:163, 8: Unused variable \'pd\' (unused-variable)
</string>
<string>
W:140, 42: Redefining built-in \'format\' (redefined-builtin)
</string>
<string>
W:189, 4: Redefining built-in \'range\' (redefined-builtin)
</string>
<string>
W:216, 10: No exception type(s) specified (bare-except)
</string>
</tuple>
</value>
</item>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment