Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
EBVCubeVisualizerPlugin
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
no67wuwu
EBVCubeVisualizerPlugin
Commits
0de74872
Commit
0de74872
authored
2 years ago
by
Emmanuel Oceguera Conchas
Browse files
Options
Downloads
Patches
Plain Diff
the variables(child) has been added to the topLevelItem
parent
189d91c6
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
netCDF_visualizer_funtionality.py
+20
-12
20 additions, 12 deletions
netCDF_visualizer_funtionality.py
with
20 additions
and
12 deletions
netCDF_visualizer_funtionality.py
+
20
−
12
View file @
0de74872
...
@@ -100,9 +100,9 @@ class maskAndFuntionality (BASE, WIDGET):
...
@@ -100,9 +100,9 @@ class maskAndFuntionality (BASE, WIDGET):
#we remove the path from the text space
#we remove the path from the text space
self
.
text_set
.
clear
()
self
.
text_set
.
clear
()
#we remove the information from the table widget
#we remove the information from the table widget
self
.
tree_data
.
clear
Contents
()
self
.
tree_data
.
clear
()
#we remove the information from the listWidget
#we remove the information from the listWidget
self
.
column_data
.
clear
Contents
()
#
self.column_data.clear()
...
@@ -113,25 +113,33 @@ class maskAndFuntionality (BASE, WIDGET):
...
@@ -113,25 +113,33 @@ class maskAndFuntionality (BASE, WIDGET):
#we get the path from the text space
#we get the path from the text space
if
self
.
text_set
.
text
()
==
""
:
#if the text space is empty
if
self
.
text_set
.
text
()
==
""
:
#if the text space is empty
QmessageBox
.
warning
(
None
,
"
Warning
"
,
"
Please select a netCDF file
"
)
#we show a warning
QmessageBox
.
warning
(
None
,
"
Warning
"
,
"
Please select a netCDF file
"
)
#we show a warning
else
:
#if the text space is not empty
else
:
#if the text space is not empty
path
=
self
.
text_set
.
text
()
#we get the path from the text space
path
=
self
.
text_set
.
text
()
#we get the path from the text space
#we load the netCDF file
#we load the netCDF file
ncFile
=
nc
.
Dataset
(
path
,
'
r
'
,
format
=
'
NETCDF4
'
)
ncFile
=
nc
.
Dataset
(
path
,
'
r
'
,
format
=
'
NETCDF4
'
)
#we get the name of the netCDF file to show it in the GUI
#we get the name of the netCDF file to show it in the GUI
ncFileName
=
QTreeWidgetItem
([
os
.
path
.
basename
(
path
)
])
ncFileName
=
os
.
path
.
basename
(
path
)
#We get the title of the netCDF file
#We get the title of the netCDF file
ncFileTitle
=
QTreeWidgetItem
([
ncFile
.
title
])
ncFileTitle
=
ncFile
.
title
#convert file name and file title into a QTreeWidgetItem
top_level
=
QTreeWidgetItem
([
ncFileName
,
ncFileTitle
])
#we get the variables of the netCDf file
#we get the variables of the netCDf file
ncFileVariables
=
ncFile
.
variables
ncFileVariables
Name
=
list
(
ncFile
.
variables
.
keys
())
#we set the top of the tree that it is the name od the file
#we set the top of the tree that it is the name od the file
self
.
tree_data
.
addTopLevelItem
(
ncFileName
)
self
.
tree_data
.
addTopLevelItem
(
top_level
)
"""
we shoe the variables of the file in the QTreeWidgetite
"""
for
i
in
range
(
len
(
ncFileVariablesName
)):
child
=
QTreeWidgetItem
([
ncFileVariablesName
[
i
]])
top_level
.
addChild
(
child
)
# #we set the dimensions in the ListWidget
#we set the dimensions in the ListWidget
# self.column_data.addItems(ncFileDimensions)
self
.
column_data
.
addItems
(
ncFileDimensions
)
# #we set the variables in the ListWidget
#we set the variables in the ListWidget
# self.column_data.addItems(ncFileVariables)
self
.
column_data
.
addItems
(
ncFileVariables
)
...
...
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