Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DM-10328: len(propertySet) throws an exception in Python #27

Merged
merged 5 commits into from
Apr 27, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 2 additions & 3 deletions python/lsst/daf/base/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#
# LSST Data Management System
#
# Copyright 2008-2016 AURA/LSST.
#
# Copyright 2008-2017 AURA/LSST.
#
# This product includes software developed by the
# LSST Project (http://www.lsst.org/).
#
Expand All @@ -26,4 +26,3 @@
from .citizen import *
from .dateTime import *
from .propertyContainer import *

16 changes: 8 additions & 8 deletions python/lsst/daf/base/citizen/__init__.py
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
#
#
# LSST Data Management System
#
# Copyright 2008-2017 AURA/LSST.
#
#
# This product includes software developed by the
# LSST Project (http://www.lsst.org/).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the LSST License Statement and
# the GNU General Public License along with this program. If not,
# see <https://www.lsstcorp.org/LegalNotices/>.
#
# You should have received a copy of the LSST License Statement and
# the GNU General Public License along with this program. If not,
# see <http://www.lsstcorp.org/LegalNotices/>.
#
from __future__ import absolute_import

from .citizen import *
from .citizenContinued import *
from .citizenContinued import *
10 changes: 4 additions & 6 deletions python/lsst/daf/base/citizen/citizenContinued.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
# LSST Data Management System
#
# Copyright 2008-2016 AURA/LSST.
# Copyright 2008-2017 AURA/LSST.
#
# This product includes software developed by the
# LSST Project (http://www.lsst.org/).
Expand All @@ -18,12 +18,10 @@
#
# You should have received a copy of the LSST License Statement and
# the GNU General Public License along with this program. If not,
# see <https://www.lsstcorp.org/LegalNotices/>.
# see <http://www.lsstcorp.org/LegalNotices/>.
#

from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import absolute_import, division, print_function

__all__ = ["setCallbacks", "mortal"]

Expand All @@ -32,6 +30,7 @@

from .citizen import Citizen


def setCallbacks(new=None, delete=None, both=False):
"""Set the callback IDs for the Citizen; if both is true, set both new and delete to the same value

Expand Down Expand Up @@ -112,4 +111,3 @@ def mortal(memId0=0, nleakPrintMax=20, first=True, showTypes=None):
print("...")
for i in range(nleakPrintMax - 1, -1, -1):
print(census[i])

16 changes: 8 additions & 8 deletions python/lsst/daf/base/dateTime/__init__.py
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
#
#
# LSST Data Management System
#
# Copyright 2008-2017 AURA/LSST.
#
#
# This product includes software developed by the
# LSST Project (http://www.lsst.org/).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the LSST License Statement and
# the GNU General Public License along with this program. If not,
# see <https://www.lsstcorp.org/LegalNotices/>.
#
# You should have received a copy of the LSST License Statement and
# the GNU General Public License along with this program. If not,
# see <http://www.lsstcorp.org/LegalNotices/>.
#
from __future__ import absolute_import

from .dateTime import *
from .dateTimeContinued import *
from .dateTimeContinued import *
38 changes: 31 additions & 7 deletions python/lsst/daf/base/dateTime/dateTimeContinued.py
Original file line number Diff line number Diff line change
@@ -1,28 +1,52 @@
from __future__ import absolute_import
#
# LSST Data Management System
#
# Copyright 2008-2017 AURA/LSST.
#
# This product includes software developed by the
# LSST Project (http://www.lsst.org/).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the LSST License Statement and
# the GNU General Public License along with this program. If not,
# see <http://www.lsstcorp.org/LegalNotices/>.
#

from __future__ import absolute_import, division, print_function

__all__ = []

from lsst.utils import continueClass

from .dateTime import DateTime

@continueClass

@continueClass # noqa F811
class DateTime:

def toPython(self, timescale=None):
"""Convert a DateTime to Python's datetime

@param timescale Timescale for resultant datetime
"""
import datetime
nsecs = self.nsecs(timescale) if timescale is not None else self.nsecs()
return datetime.datetime.utcfromtimestamp(nsecs/10**9)

def __repr__(self):
if self.isValid():
return "DateTime(\"{}\", TAI)".format(self.toString(DateTime.TAI))
else:
return "DateTime()"

def __reduce__(self):
return (DateTime, (self.nsecs(), ))

def __reduce__(self):
return (DateTime, (self.nsecs(), ))
16 changes: 8 additions & 8 deletions python/lsst/daf/base/propertyContainer/__init__.py
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
#
#
# LSST Data Management System
#
# Copyright 2008-2017 AURA/LSST.
#
#
# This product includes software developed by the
# LSST Project (http://www.lsst.org/).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the LSST License Statement and
# the GNU General Public License along with this program. If not,
# see <https://www.lsstcorp.org/LegalNotices/>.
#
# You should have received a copy of the LSST License Statement and
# the GNU General Public License along with this program. If not,
# see <http://www.lsstcorp.org/LegalNotices/>.
#
from __future__ import absolute_import

from .propertySet import *
from .propertyList import *
from .propertyContainerContinued import *
from .propertyContainerContinued import *