Skip to content

Commit

Permalink
Merge branch 'stable' into release-v0.23.x
Browse files Browse the repository at this point in the history
# Conflicts:
#	azure-pipelines.yml
#	doc/conf.py
#	numina/array/bpm.cpp
#	numina/array/clippix.c
#	numina/array/peaks/kernels.c
#	numina/array/trace/extract.cpp
#	numina/array/trace/traces.cpp
#	numina/version.py
#	src/nirproc.cpp
  • Loading branch information
sergiopasra committed Sep 24, 2020
2 parents 0e006e7 + b86fa84 commit 93d815e
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
20 changes: 19 additions & 1 deletion numina/array/tests/test_ramp_cy.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright 2008-2014 Universidad Complutense de Madrid
# Copyright 2008-2018 Universidad Complutense de Madrid
#
# This file is part of Numina
#
Expand Down Expand Up @@ -288,5 +288,23 @@ def test_suite():
suite.addTest(unittest.makeSuite(FollowUpTheRampTestCase))
return suite


def test_simple():

a = numpy.ones((1,1))
base = 2400 * numpy.ones((1, 1))
n = 5
slope = 2.8
cube = numpy.empty((n,1,1))
dt = 0.1
# times are: [i * dt]
for i in range(n):
cube[i] = base + slope * dt * a * i

m = ramp_array(cube, ti=dt*(n-1))

assert numpy.allclose(m[0][0,0], slope)


if __name__ == '__main__':
unittest.main(defaultTest='test_suite')
12 changes: 12 additions & 0 deletions numina/types/datatype.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,18 @@ def validate(self, obj):
return True


class AnyType(DataType):
"""Type representing anything"""
def __init__(self):
super(AnyType, self).__init__(ptype=self.__class__)

def convert(self, obj):
return obj

def validate(self, obj):
return True


class NullType(DataType):
"""Data type for None."""
def __init__(self):
Expand Down

0 comments on commit 93d815e

Please sign in to comment.