Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pycroscopy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
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
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
Vasudevan, Rama K.
pycroscopy
Commits
fc879cb5
Commit
fc879cb5
authored
7 years ago
by
Somnath, Suhas
Browse files
Options
Downloads
Patches
Plain Diff
Replaced requests (very slow) with wget
parent
df61fbfd
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!112
Improved examples with real sample data
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
examples/load_dataset_example.py
+10
-6
10 additions, 6 deletions
examples/load_dataset_example.py
with
10 additions
and
6 deletions
examples/load_dataset_example.py
+
10
−
6
View file @
fc879cb5
...
...
@@ -23,19 +23,23 @@ In this example, we will be loading the Raw_Data dataset from the hdf5 file.
from
__future__
import
division
,
print_function
,
absolute_import
,
unicode_literals
import
h5py
import
requests
try
:
# This package is not part of anaconda and may need to be installed.
import
wget
except
ImportError
:
import
pip
pip
.
main
([
'
install
'
,
'
wget
'
])
import
wget
from
os
import
remove
import
pycroscopy
as
px
# Downloading the file from the pycroscopy Github project
url
=
'
https://raw.githubusercontent.com/pycroscopy/pycroscopy/master/data/BELine_0004.h5
'
h5_path
=
'
temp.h5
'
r
=
requests
.
get
(
url
,
stream
=
True
)
with
open
(
h5_path
,
'
wb
'
)
as
f
:
for
chunk
in
r
.
iter_content
():
f
.
write
(
chunk
)
_
=
wget
.
download
(
url
,
h5_path
)
#h5_path = px.io_utils.uiGetFile(caption='Select .h5 file', filter='HDF5 file (*.h5)')
#
h5_path = px.io_utils.uiGetFile(caption='Select .h5 file', filter='HDF5 file (*.h5)')
# Read the file using using h5py:
h5_file1
=
h5py
.
File
(
h5_path
,
'
r
'
)
...
...
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