LSST Applications g1653933729+a8ce1bb630,g1a997c3884+a8ce1bb630,g28da252d5a+391ac6d39e,g2bbee38e9b+97aa061eef,g2bc492864f+97aa061eef,g2cdde0e794+3ad5f2bb52,g3156d2b45e+07302053f8,g347aa1857d+97aa061eef,g35bb328faa+a8ce1bb630,g3a166c0a6a+97aa061eef,g3e281a1b8c+693a468c5f,g4005a62e65+17cd334064,g414038480c+56e3b84a79,g41af890bb2+26583d4ff1,g4e1a3235cc+71f04f4444,g6249c6f860+e8b3ddfa16,g80478fca09+470ebe5ec2,g82479be7b0+a854ea7213,g858d7b2824+54af6d8f4a,g9125e01d80+a8ce1bb630,g923454667a+54af6d8f4a,ga5288a1d22+f6c1365cb4,gae0086650b+a8ce1bb630,gb58c049af0+d64f4d3760,gc28159a63d+97aa061eef,gcf0d15dbbd+de0d256a90,gd35896b8e2+b4ef8454f8,gd6b7c0dfd1+1374441cbd,gda3e153d99+54af6d8f4a,gda6a2b7d83+de0d256a90,gdaeeff99f8+1711a396fd,ge2409df99d+70d1dae83b,ge33fd446bb+54af6d8f4a,ge79ae78c31+97aa061eef,gf0baf85859+5daf287408,gf5289d68f6+7d21c4adaf,gfa443fc69c+6d8005ba5e,gfda6b12a05+3bcad770a9,w.2024.42
LSST Data Management Base Package
Loading...
Searching...
No Matches
test_bindings.py
Go to the documentation of this file.
1# This file is part of gauss2d.
2#
3# Developed for the LSST Data Management System.
4# This product includes software developed by the LSST Project
5# (https://www.lsst.org).
6# See the COPYRIGHT file at the top-level directory of this distribution
7# for details of code ownership.
8#
9# This program is free software: you can redistribute it and/or modify
10# it under the terms of the GNU General Public License as published by
11# the Free Software Foundation, either version 3 of the License, or
12# (at your option) any later version.
13#
14# This program is distributed in the hope that it will be useful,
15# but WITHOUT ANY WARRANTY; without even the implied warranty of
16# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17# GNU General Public License for more details.
18#
19# You should have received a copy of the GNU General Public License
20# along with this program. If not, see <https://www.gnu.org/licenses/>.
21
22import lsst.gauss2d as g2d
23
24
26 errors = []
27 bad_args_msg = "incompatible function arguments"
28
29 for name_class in dir(g2d):
30 klass = getattr(g2d, name_class)
31
32 if callable(klass):
33 try:
34 obj = klass()
35 except ValueError:
36 # Likely non-trivial __init__
37 continue
38 except TypeError as e:
39 msg = str(e)
40 if not (
41 msg.endswith("No constructor defined!")
42 or msg.startswith("__init__(): incompatible constructor arguments.")
43 or msg.startswith("extend_path() missing")
44 or (msg.startswith("make_gaussians_pixel") and (bad_args_msg in msg))
45 ):
46 errors.append(e)
47 # str and repr should not raise
48 try:
49 repr(obj)
50 except Exception as e:
51 errors.append(e)
52 try:
53 str(obj)
54 except Exception as e:
55 errors.append(e)
56
57 if errors:
58 print('\n'.join((str(e) for e in errors)))
59 assert not 'errors not empty; see stdout'