LSST Applications  21.0.0+04719a4bac,21.0.0-1-ga51b5d4+f5e6047307,21.0.0-11-g2b59f77+a9c1acf22d,21.0.0-11-ga42c5b2+86977b0b17,21.0.0-12-gf4ce030+76814010d2,21.0.0-13-g1721dae+760e7a6536,21.0.0-13-g3a573fe+768d78a30a,21.0.0-15-g5a7caf0+f21cbc5713,21.0.0-16-g0fb55c1+b60e2d390c,21.0.0-19-g4cded4ca+71a93a33c0,21.0.0-2-g103fe59+bb20972958,21.0.0-2-g45278ab+04719a4bac,21.0.0-2-g5242d73+3ad5d60fb1,21.0.0-2-g7f82c8f+8babb168e8,21.0.0-2-g8f08a60+06509c8b61,21.0.0-2-g8faa9b5+616205b9df,21.0.0-2-ga326454+8babb168e8,21.0.0-2-gde069b7+5e4aea9c2f,21.0.0-2-gecfae73+1d3a86e577,21.0.0-2-gfc62afb+3ad5d60fb1,21.0.0-25-g1d57be3cd+e73869a214,21.0.0-3-g357aad2+ed88757d29,21.0.0-3-g4a4ce7f+3ad5d60fb1,21.0.0-3-g4be5c26+3ad5d60fb1,21.0.0-3-g65f322c+e0b24896a3,21.0.0-3-g7d9da8d+616205b9df,21.0.0-3-ge02ed75+a9c1acf22d,21.0.0-4-g591bb35+a9c1acf22d,21.0.0-4-g65b4814+b60e2d390c,21.0.0-4-gccdca77+0de219a2bc,21.0.0-4-ge8a399c+6c55c39e83,21.0.0-5-gd00fb1e+05fce91b99,21.0.0-6-gc675373+3ad5d60fb1,21.0.0-64-g1122c245+4fb2b8f86e,21.0.0-7-g04766d7+cd19d05db2,21.0.0-7-gdf92d54+04719a4bac,21.0.0-8-g5674e7b+d1bd76f71f,master-gac4afde19b+a9c1acf22d,w.2021.13
LSST Data Management Base Package
Namespaces | Classes | Functions
lsst::daf::base Namespace Reference

Namespaces

 dateTime
 
 propertyContainer
 
 version
 
 yaml
 

Classes

class  DateTime
 Class for handling dates/times, including MJD, UTC, and TAI. More...
 
class  Persistable
 Base class for all persistable classes. More...
 
class  PropertyList
 Class for storing ordered metadata with comments. More...
 
class  PropertySet
 Class for storing generic metadata. More...
 

Functions

template<>
void PropertySet::add< PropertySet::Ptr > (std::string const &name, Ptr const &value)
 
template<>
void PropertySet::add< PropertySet::Ptr > (std::string const &name, std::vector< Ptr > const &value)
 
 PYBIND11_MODULE (dateTime, mod)
 
 PYBIND11_MODULE (persistable, mod)
 
 PYBIND11_MODULE (propertyList, mod)
 
 PYBIND11_MODULE (propertySet, mod)
 

Function Documentation

◆ PropertySet::add< PropertySet::Ptr >() [1/2]

template<>
void lsst::daf::base::PropertySet::add< PropertySet::Ptr > ( std::string const &  name,
Ptr const &  value 
)

◆ PropertySet::add< PropertySet::Ptr >() [2/2]

template<>
void lsst::daf::base::PropertySet::add< PropertySet::Ptr > ( std::string const &  name,
std::vector< Ptr > const &  value 
)

◆ PYBIND11_MODULE() [1/4]

lsst::daf::base::PYBIND11_MODULE ( dateTime  ,
mod   
)

Definition at line 12 of file dateTime.cc.

12  {
13  py::class_<DateTime> cls(mod, "DateTime");
14 
15  py::enum_<DateTime::Timescale>(cls, "Timescale")
16  .value("TAI", DateTime::Timescale::TAI)
17  .value("UTC", DateTime::Timescale::UTC)
18  .value("TT", DateTime::Timescale::TT)
19  .export_values();
20 
21  py::enum_<DateTime::DateSystem>(cls, "DateSystem")
22  .value("JD", DateTime::DateSystem::JD)
23  .value("MJD", DateTime::DateSystem::MJD)
24  .value("EPOCH", DateTime::DateSystem::EPOCH)
25  .export_values();
26 
27  cls.def(py::init<>())
28  .def_readonly_static("invalid_nsecs", &DateTime::invalid_nsecs)
29  .def(py::init<long long, DateTime::Timescale>(), "nsecs"_a, "scale"_a = DateTime::Timescale::TAI)
30  .def(py::init<double, DateTime::DateSystem, DateTime::Timescale>(), "date"_a,
31  "system"_a = DateTime::DateSystem::MJD, "scale"_a = DateTime::Timescale::TAI)
32  .def(py::init<int, int, int, int, int, int, DateTime::Timescale>())
33  .def(py::init<const std::string &, DateTime::Timescale>())
34  .def("nsecs", &DateTime::nsecs, "scale"_a = DateTime::Timescale::TAI)
35  .def("get", &DateTime::get, "system"_a = DateTime::DateSystem::MJD,
36  "scale"_a = DateTime::Timescale::TAI)
37  .def("toString", &DateTime::toString)
38  .def("gmtime", &DateTime::gmtime)
39  .def("timespec", &DateTime::timespec)
40  .def("timeval", &DateTime::timeval)
41  .def("isValid", &DateTime::isValid)
42  .def_static("now", &DateTime::now)
43  .def_static("initializeLeapSeconds", &DateTime::initializeLeapSeconds)
44  .def("__eq__", [](DateTime const &self, DateTime const &other) { return self == other; },
45  py::is_operator());
46 }
ItemVariant const * other
Definition: Schema.cc:56
bool isValid
Definition: fits.cc:399

◆ PYBIND11_MODULE() [2/4]

lsst::daf::base::PYBIND11_MODULE ( persistable  ,
mod   
)

Definition at line 14 of file persistable.cc.

14  {
15  py::class_<Persistable, std::shared_ptr<Persistable>> cls(mod, "Persistable");
16 }

◆ PYBIND11_MODULE() [3/4]

lsst::daf::base::PYBIND11_MODULE ( propertyList  ,
mod   
)

Definition at line 59 of file propertyList.cc.

59  {
60  py::module::import("lsst.daf.base.persistable");
61 
62  py::class_<PropertyList, std::shared_ptr<PropertyList>, PropertySet> cls(mod, "PropertyList");
63 
64  cls.def(py::init<>());
65 
66  cls.def("getComment", &PropertyList::getComment);
67  cls.def("getOrderedNames", &PropertyList::getOrderedNames);
68  cls.def("deepCopy",
69  [](PropertyList const& self) { return std::static_pointer_cast<PropertySet>(self.deepCopy()); });
70  declareAccessors<bool>(cls, "Bool");
71  declareAccessors<short>(cls, "Short");
72  declareAccessors<int>(cls, "Int");
73  declareAccessors<long>(cls, "Long");
74  declareAccessors<long long>(cls, "LongLong");
75  declareAccessors<float>(cls, "Float");
76  declareAccessors<double>(cls, "Double");
77  declareAccessors<nullptr_t>(cls, "Undef");
78  declareAccessors<std::string>(cls, "String");
79  declareAccessors<DateTime>(cls, "DateTime");
80 
81  cls.def("setPropertySet",
82  (void (PropertyList::*)(std::string const&, PropertySet::Ptr const&)) & PropertyList::set);
83 }
daf::base::PropertySet * set
Definition: fits.cc:912

◆ PYBIND11_MODULE() [4/4]

lsst::daf::base::PYBIND11_MODULE ( propertySet  ,
mod   
)

Definition at line 49 of file propertySet.cc.

49  {
50  py::module::import("lsst.daf.base.persistable");
51 
52  py::class_<std::type_info>(mod, "TypeInfo")
53  .def("__eq__",
54  [](std::type_info const& self, std::type_info const& other) { return self == other; })
55  .def("__ne__",
56  [](std::type_info const& self, std::type_info const& other) { return self != other; })
57  .def("name", &std::type_info::name)
58  .def("__hash__", &std::type_info::hash_code);
59 
60  py::class_<PropertySet, std::shared_ptr<PropertySet>> cls(mod, "PropertySet");
61 
62  cls.def(py::init<bool>(), "flat"_a = false);
63 
64  cls.def("deepCopy", &PropertySet::deepCopy);
65  cls.def("nameCount", &PropertySet::nameCount, "topLevelOnly"_a = true);
66  cls.def("names", &PropertySet::names, "topLevelOnly"_a = true);
67  cls.def("paramNames", &PropertySet::paramNames, "topLevelOnly"_a = true);
68  cls.def("propertySetNames", &PropertySet::propertySetNames, "topLevelOnly"_a = true);
69  cls.def("exists", &PropertySet::exists);
70  cls.def("isArray", &PropertySet::isArray);
71  cls.def("isUndefined", &PropertySet::isUndefined);
72  cls.def("isPropertySetPtr", &PropertySet::isPropertySetPtr);
73  cls.def("valueCount",
74  py::overload_cast<>(&PropertySet::valueCount, py::const_));
75  cls.def("valueCount",
76  py::overload_cast<std::string const&>(&PropertySet::valueCount,
77  py::const_));
78  cls.def("typeOf", &PropertySet::typeOf, py::return_value_policy::reference);
79  cls.def("toString", &PropertySet::toString, "topLevelOnly"_a = false, "indent"_a = "");
80  cls.def("copy", &PropertySet::copy, "dest"_a, "source"_a, "name"_a, "asScalar"_a=false);
81  cls.def("combine", &PropertySet::combine);
82  cls.def("remove", &PropertySet::remove);
83  cls.def("getAsBool", &PropertySet::getAsBool);
84  cls.def("getAsInt", &PropertySet::getAsInt);
85  cls.def("getAsInt64", &PropertySet::getAsInt64);
86  cls.def("getAsUInt64", &PropertySet::getAsUInt64);
87  cls.def("getAsDouble", &PropertySet::getAsDouble);
88  cls.def("getAsString", &PropertySet::getAsString);
89  cls.def("getAsPropertySetPtr", &PropertySet::getAsPropertySetPtr);
90  cls.def("getAsPersistablePtr", &PropertySet::getAsPersistablePtr);
91 
92  declareAccessors<bool>(cls, "Bool");
93  declareAccessors<short>(cls, "Short");
94  declareAccessors<int>(cls, "Int");
95  declareAccessors<long>(cls, "Long");
96  declareAccessors<long long>(cls, "LongLong");
97  declareAccessors<unsigned long long>(cls, "UnsignedLongLong");
98  declareAccessors<float>(cls, "Float");
99  declareAccessors<double>(cls, "Double");
100  declareAccessors<nullptr_t>(cls, "Undef");
101  declareAccessors<std::string>(cls, "String");
102  declareAccessors<DateTime>(cls, "DateTime");
103  declareAccessors<std::shared_ptr<PropertySet>>(cls, "PropertySet");
104 }
T hash_code(T... args)
T name(T... args)