Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pulse_lib
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
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
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
QuTech QDLabs
pulse_lib
Commits
5503c680
Commit
5503c680
authored
2 years ago
by
Sander Snoo
Browse files
Options
Downloads
Patches
Plain Diff
Added endpoint to linspace, logspace and geomspace.
parent
aa49621e
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
pulse_lib/segments/utility/looping.py
+15
-6
15 additions, 6 deletions
pulse_lib/segments/utility/looping.py
with
15 additions
and
6 deletions
pulse_lib/segments/utility/looping.py
+
15
−
6
View file @
5503c680
...
...
@@ -220,21 +220,30 @@ class loop_obj():
class
linspace
(
loop_obj
):
"""
docstring for linspace
"""
def
__init__
(
self
,
start
,
stop
,
n_steps
=
50
,
name
=
None
,
unit
=
None
,
axis
=
-
1
,
setvals
=
None
):
def
__init__
(
self
,
start
,
stop
,
n_steps
=
50
,
name
=
None
,
unit
=
None
,
axis
=
-
1
,
setvals
=
None
,
endpoint
=
True
):
super
().
__init__
()
super
().
add_data
(
np
.
linspace
(
start
,
stop
,
n_steps
),
axis
=
axis
,
labels
=
name
,
units
=
unit
,
setvals
=
setvals
)
super
().
add_data
(
np
.
linspace
(
start
,
stop
,
n_steps
,
endpoint
=
endpoint
),
axis
=
axis
,
labels
=
name
,
units
=
unit
,
setvals
=
setvals
)
class
logspace
(
loop_obj
):
"""
docstring for logspace
"""
def
__init__
(
self
,
start
,
stop
,
n_steps
=
50
,
name
=
None
,
unit
=
None
,
axis
=
-
1
,
setvals
=
None
):
def
__init__
(
self
,
start
,
stop
,
n_steps
=
50
,
name
=
None
,
unit
=
None
,
axis
=
-
1
,
setvals
=
None
,
endpoint
=
True
):
super
().
__init__
()
super
().
add_data
(
np
.
logspace
(
start
,
stop
,
n_steps
),
axis
=
axis
,
labels
=
name
,
units
=
unit
,
setvals
=
setvals
)
super
().
add_data
(
np
.
logspace
(
start
,
stop
,
n_steps
,
endpoint
=
endpoint
),
axis
=
axis
,
labels
=
name
,
units
=
unit
,
setvals
=
setvals
)
class
geomspace
(
loop_obj
):
"""
docstring for geomspace
"""
def
__init__
(
self
,
start
,
stop
,
n_steps
=
50
,
name
=
None
,
unit
=
None
,
axis
=
-
1
,
setvals
=
None
):
def
__init__
(
self
,
start
,
stop
,
n_steps
=
50
,
name
=
None
,
unit
=
None
,
axis
=
-
1
,
setvals
=
None
,
endpoint
=
True
):
super
().
__init__
()
super
().
add_data
(
np
.
geomspace
(
start
,
stop
,
n_steps
),
axis
=
axis
,
labels
=
name
,
units
=
unit
,
setvals
=
setvals
)
super
().
add_data
(
np
.
geomspace
(
start
,
stop
,
n_steps
,
endpoint
=
endpoint
),
axis
=
axis
,
labels
=
name
,
units
=
unit
,
setvals
=
setvals
)
if
__name__
==
'
__main__
'
:
lp
=
loop_obj
()
...
...
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