Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
spinifex
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
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
Container 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
ResearchAndDevelopment
spinifex
Commits
e303bf47
Commit
e303bf47
authored
2 months ago
by
Maaijke Mevius
Browse files
Options
Downloads
Patches
Plain Diff
disable plint duplicate-code for tests
parent
eebf6c17
No related branches found
No related tags found
2 merge requests
!12
Rmcalc
,
!8
Draft: Magnetic
Pipeline
#101518
passed
2 months ago
Stage: prepare
Stage: lint
Stage: test
Stage: package
Stage: images
Stage: integration
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
tests/test_geometry.py
+11
-6
11 additions, 6 deletions
tests/test_geometry.py
tests/test_ionospheric.py
+1
-1
1 addition, 1 deletion
tests/test_ionospheric.py
tests/test_magnetic.py
+4
-4
4 additions, 4 deletions
tests/test_magnetic.py
with
16 additions
and
11 deletions
tests/test_geometry.py
+
11
−
6
View file @
e303bf47
# pylint: disable=duplicate-code
from
__future__
import
annotations
import
astropy.units
as
u
import
numpy
as
np
from
astropy.coordinates
import
EarthLocation
,
SkyCoord
from
astropy.time
import
Time
from
spinifex.geometry
import
get_ipp
from
spinifex.geometry
.get_ipp
import
IPP
,
get_ipp
_from_skycoord
def
test_geometry
():
"""
Test the geometry module
"""
def
get_test_ipp
()
->
IPP
:
source
=
SkyCoord
.
from_name
(
"
Cas A
"
)
lon
=
6.367
*
u
.
deg
lat
=
52.833
*
u
.
deg
heights
=
np
.
arange
(
100
,
2000
,
100
)
*
u
.
km
dwingeloo
=
EarthLocation
(
lon
=
lon
,
lat
=
lat
,
height
=
0
*
u
.
km
)
times
=
Time
(
"
2020-0
3
-2
1
T01:00:00
"
)
+
np
.
arange
(
0
,
10
)
*
15
*
u
.
min
ipp
=
get_ipp
.
get_ipp_from_skycoord
(
times
=
Time
(
"
2020-0
1
-2
0
T01:00:00
"
)
+
np
.
arange
(
0
,
10
)
*
15
*
u
.
min
return
get_ipp_from_skycoord
(
loc
=
dwingeloo
,
times
=
times
,
source
=
source
,
height_array
=
heights
)
assert
isinstance
(
ipp
,
get_ipp
.
IPP
)
def
test_geometry
():
"""
Test the geometry module
"""
ipp
=
get_test_ipp
()
assert
isinstance
(
ipp
,
IPP
)
assert
isinstance
(
ipp
.
airmass
,
np
.
ndarray
)
This diff is collapsed.
Click to expand it.
tests/test_ionospheric.py
+
1
−
1
View file @
e303bf47
# Copyright (C) 2023 ASTRON (Netherlands Institute for Radio Astronomy)
# SPDX-License-Identifier: Apache-2.0
# pylint: disable=duplicate-code
"""
Testing of ionospheric
"""
from
__future__
import
annotations
...
...
This diff is collapsed.
Click to expand it.
tests/test_magnetic.py
+
4
−
4
View file @
e303bf47
# Copyright (C) 2023 ASTRON (Netherlands Institute for Radio Astronomy)
# SPDX-License-Identifier: Apache-2.0
# pylint: disable=duplicate-code
"""
Testing of magnetic
"""
from
__future__
import
annotations
...
...
@@ -9,7 +9,7 @@ import astropy.units as u
import
numpy
as
np
from
astropy.coordinates
import
EarthLocation
,
SkyCoord
from
astropy.time
import
Time
from
spinifex.geometry
import
get_ipp
from
spinifex.geometry
.get_ipp
import
get_ipp
_from_skycoord
from
spinifex.magnetic
import
magnetic_models
...
...
@@ -29,8 +29,8 @@ def test_get_magnetic_field():
lat
=
52.833
*
u
.
deg
heights
=
np
.
arange
(
100
,
2000
,
100
)
*
u
.
km
dwingeloo
=
EarthLocation
(
lon
=
lon
,
lat
=
lat
,
height
=
0
*
u
.
km
)
times
=
Time
(
"
2020-0
3
-2
1
T01:00:00
"
)
+
np
.
arange
(
0
,
10
)
*
15
*
u
.
min
ipp
=
get_ipp
.
get_ipp_from_skycoord
(
times
=
Time
(
"
2020-0
1
-2
0
T01:00:00
"
)
+
np
.
arange
(
0
,
10
)
*
15
*
u
.
min
ipp
=
get_ipp_from_skycoord
(
loc
=
dwingeloo
,
times
=
times
,
source
=
source
,
height_array
=
heights
)
field
=
magnetic_models
.
ppigrf
(
ipp
)
...
...
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