Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
csst-pipeline
csst_proto
Commits
70025824
Commit
70025824
authored
2 years ago
by
BO ZHANG
Browse files
Options
Download
Email Patches
Plain Diff
tweaks to fit Numpydoc standards
parent
ef7266b8
dev
main
No related merge requests found
Pipeline
#174
passed with stages
in 13 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
csst_proto/flip_image.py
+23
-7
csst_proto/flip_image.py
csst_proto/some_other_modules.py
+14
-1
csst_proto/some_other_modules.py
with
37 additions
and
8 deletions
+37
-8
csst_proto/flip_image.py
+
23
-
7
View file @
70025824
import
numpy
as
np
from
astropy
import
table
from
.
import
PACKAGE_PATH
# the main algorithm
def
flip_image
(
img
:
np
.
ndarray
)
->
np
.
ndarray
:
""" flip an input image
"""
Flip an input image.
This function uses an awesome algorithm to flip an input image.
Parameters
----------
img
:
t
he input image
img
: np.ndarray
T
he input image
.
Returns
-------
img_flipped:
np.ndarray
t
he flipped image
np.ndarray
T
he flipped image
.
Examples
--------
>>> flip_image(np.array([1, 2], [3, 4]))
"""
try
:
assert
img
.
ndim
==
2
...
...
@@ -30,7 +33,20 @@ def flip_image(img: np.ndarray) -> np.ndarray:
# a demo on how to read test image
def
read_test_image
():
""" read test image """
"""
Read test image.
This function reads the test image associated with this package.
Returns
-------
np.ndarray
The test image.
Examples
--------
>>> test_image = read_test_image()
"""
fp_img
=
PACKAGE_PATH
+
"/data/test_image.txt"
print
(
"reading file {} ..."
.
format
(
fp_img
))
return
np
.
loadtxt
(
fp_img
,
dtype
=
int
)
This diff is collapsed.
Click to expand it.
csst_proto/some_other_modules.py
+
14
-
1
View file @
70025824
def
a_demo_function
(
*
args
):
""" a demo function """
"""
A demo function.
This function is a demo.
Parameters
----------
*args : any
The argument list.
Examples
--------
>>> a_demo_function(None)
"""
return
None
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Snippets