LSST Applications g070148d5b3+33e5256705,g0d53e28543+25c8b88941,g0da5cf3356+2dd1178308,g1081da9e2a+62d12e78cb,g17e5ecfddb+7e422d6136,g1c76d35bf8+ede3a706f7,g295839609d+225697d880,g2e2c1a68ba+cc1f6f037e,g2ffcdf413f+853cd4dcde,g38293774b4+62d12e78cb,g3b44f30a73+d953f1ac34,g48ccf36440+885b902d19,g4b2f1765b6+7dedbde6d2,g5320a0a9f6+0c5d6105b6,g56b687f8c9+ede3a706f7,g5c4744a4d9+ef6ac23297,g5ffd174ac0+0c5d6105b6,g6075d09f38+66af417445,g667d525e37+2ced63db88,g670421136f+2ced63db88,g71f27ac40c+2ced63db88,g774830318a+463cbe8d1f,g7876bc68e5+1d137996f1,g7985c39107+62d12e78cb,g7fdac2220c+0fd8241c05,g96f01af41f+368e6903a7,g9ca82378b8+2ced63db88,g9d27549199+ef6ac23297,gabe93b2c52+e3573e3735,gb065e2a02a+3dfbe639da,gbc3249ced9+0c5d6105b6,gbec6a3398f+0c5d6105b6,gc9534b9d65+35b9f25267,gd01420fc67+0c5d6105b6,geee7ff78d7+a14128c129,gf63283c776+ede3a706f7,gfed783d017+0c5d6105b6,w.2022.47
LSST Data Management Base Package
Loading...
Searching...
No Matches
Namespaces | Classes | Functions
lsst::daf::base Namespace Reference

Namespaces

namespace  dateTime
 
namespace  propertyContainer
 
namespace  version
 
namespace  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< std::shared_ptr< PropertySet > > (std::string const &name, std::shared_ptr< PropertySet > const &value)
 
template<>
void PropertySet::add< std::shared_ptr< PropertySet > > (std::string const &name, std::vector< std::shared_ptr< PropertySet > > const &value)
 
 PYBIND11_MODULE (dateTime, mod)
 
 PYBIND11_MODULE (persistable, mod)
 
 PYBIND11_MODULE (propertyList, mod)
 
 PYBIND11_MODULE (propertySet, mod)
 

Function Documentation

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

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

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

template<>
void lsst::daf::base::PropertySet::add< std::shared_ptr< PropertySet > > ( std::string const &  name,
std::vector< std::shared_ptr< PropertySet > > 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}
Class for handling dates/times, including MJD, UTC, and TAI.
Definition: DateTime.h:64

◆ 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 60 of file propertyList.cc.

60 {
61 py::module::import("lsst.daf.base.persistable");
62
63 py::class_<PropertyList, std::shared_ptr<PropertyList>, PropertySet> cls(mod, "PropertyList");
64
65 cls.def(py::init<>());
66
67 cls.def("getComment", &PropertyList::getComment);
68 cls.def("getOrderedNames", &PropertyList::getOrderedNames);
69 cls.def("deepCopy",
70 [](PropertyList const& self) { return std::static_pointer_cast<PropertySet>(self.deepCopy()); });
71 declareAccessors<bool>(cls, "Bool");
72 declareAccessors<short>(cls, "Short");
73 declareAccessors<int>(cls, "Int");
74 declareAccessors<long>(cls, "Long");
75 declareAccessors<long long>(cls, "LongLong");
76 declareAccessors<float>(cls, "Float");
77 declareAccessors<double>(cls, "Double");
78 declareAccessors<std::nullptr_t>(cls, "Undef");
79 declareAccessors<std::string>(cls, "String");
80 declareAccessors<DateTime>(cls, "DateTime");
81
82 cls.def("setPropertySet",
83 (void (PropertyList::*)(std::string const&, PropertySet::Ptr const&)) & PropertyList::set);
84}
Class for storing ordered metadata with comments.
Definition: PropertyList.h:68
virtual std::shared_ptr< PropertySet > deepCopy() const
Make a deep copy of the PropertyList and all of its contents.
Definition: PropertyList.cc:51
Class for storing generic metadata.
Definition: PropertySet.h:66

◆ PYBIND11_MODULE() [4/4]

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

Definition at line 50 of file propertySet.cc.

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