a2p2 0.7.5__tar.gz → 0.7.7__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {a2p2-0.7.5/a2p2.egg-info → a2p2-0.7.7}/PKG-INFO +1 -1
- {a2p2-0.7.5 → a2p2-0.7.7}/a2p2/jmmc/catalogs.py +22 -6
- {a2p2-0.7.5 → a2p2-0.7.7}/a2p2/version.py +10 -2
- {a2p2-0.7.5 → a2p2-0.7.7/a2p2.egg-info}/PKG-INFO +1 -1
- {a2p2-0.7.5 → a2p2-0.7.7}/LICENSE +0 -0
- {a2p2-0.7.5 → a2p2-0.7.7}/MANIFEST.in +0 -0
- {a2p2-0.7.5 → a2p2-0.7.7}/README.rst +0 -0
- {a2p2-0.7.5 → a2p2-0.7.7}/a2p2/__init__.py +0 -0
- {a2p2-0.7.5 → a2p2-0.7.7}/a2p2/__main__.py +0 -0
- {a2p2-0.7.5 → a2p2-0.7.7}/a2p2/chara/__init__.py +0 -0
- {a2p2-0.7.5 → a2p2-0.7.7}/a2p2/chara/facility.py +0 -0
- {a2p2-0.7.5 → a2p2-0.7.7}/a2p2/chara/gui.py +0 -0
- {a2p2-0.7.5 → a2p2-0.7.7}/a2p2/client.py +0 -0
- {a2p2-0.7.5 → a2p2-0.7.7}/a2p2/facility.py +0 -0
- {a2p2-0.7.5 → a2p2-0.7.7}/a2p2/gui.py +0 -0
- {a2p2-0.7.5 → a2p2-0.7.7}/a2p2/instrument.py +0 -0
- {a2p2-0.7.5 → a2p2-0.7.7}/a2p2/jmmc/__init__.py +0 -0
- {a2p2-0.7.5 → a2p2-0.7.7}/a2p2/jmmc/generated_models.py +0 -0
- {a2p2-0.7.5 → a2p2-0.7.7}/a2p2/jmmc/models.py +0 -0
- {a2p2-0.7.5 → a2p2-0.7.7}/a2p2/jmmc/services.py +0 -0
- {a2p2-0.7.5 → a2p2-0.7.7}/a2p2/jmmc/utils.py +0 -0
- {a2p2-0.7.5 → a2p2-0.7.7}/a2p2/jmmc/webservices.py +0 -0
- {a2p2-0.7.5 → a2p2-0.7.7}/a2p2/ob.py +0 -0
- {a2p2-0.7.5 → a2p2-0.7.7}/a2p2/samp.py +0 -0
- {a2p2-0.7.5 → a2p2-0.7.7}/a2p2/utils.py +0 -0
- {a2p2-0.7.5 → a2p2-0.7.7}/a2p2/vlti/__init__.py +0 -0
- {a2p2-0.7.5 → a2p2-0.7.7}/a2p2/vlti/conf/GRAVITY_ditTable.json +0 -0
- {a2p2-0.7.5 → a2p2-0.7.7}/a2p2/vlti/conf/GRAVITY_rangeTable.json +0 -0
- {a2p2-0.7.5 → a2p2-0.7.7}/a2p2/vlti/conf/MATISSE_ditTable.json +0 -0
- {a2p2-0.7.5 → a2p2-0.7.7}/a2p2/vlti/conf/MATISSE_rangeTable.json +0 -0
- {a2p2-0.7.5 → a2p2-0.7.7}/a2p2/vlti/conf/PIONIER_ditTable.json +0 -0
- {a2p2-0.7.5 → a2p2-0.7.7}/a2p2/vlti/conf/PIONIER_rangeTable.json +0 -0
- {a2p2-0.7.5 → a2p2-0.7.7}/a2p2/vlti/facility.py +0 -0
- {a2p2-0.7.5 → a2p2-0.7.7}/a2p2/vlti/gravity.py +0 -0
- {a2p2-0.7.5 → a2p2-0.7.7}/a2p2/vlti/gui.py +0 -0
- {a2p2-0.7.5 → a2p2-0.7.7}/a2p2/vlti/instrument.py +0 -0
- {a2p2-0.7.5 → a2p2-0.7.7}/a2p2/vlti/matisse.py +0 -0
- {a2p2-0.7.5 → a2p2-0.7.7}/a2p2/vlti/pionier.py +0 -0
- {a2p2-0.7.5 → a2p2-0.7.7}/a2p2.egg-info/SOURCES.txt +0 -0
- {a2p2-0.7.5 → a2p2-0.7.7}/a2p2.egg-info/dependency_links.txt +0 -0
- {a2p2-0.7.5 → a2p2-0.7.7}/a2p2.egg-info/entry_points.txt +0 -0
- {a2p2-0.7.5 → a2p2-0.7.7}/a2p2.egg-info/requires.txt +0 -0
- {a2p2-0.7.5 → a2p2-0.7.7}/a2p2.egg-info/top_level.txt +0 -0
- {a2p2-0.7.5 → a2p2-0.7.7}/pyproject.toml +0 -0
- {a2p2-0.7.5 → a2p2-0.7.7}/setup.cfg +0 -0
- {a2p2-0.7.5 → a2p2-0.7.7}/setup.py +0 -0
- {a2p2-0.7.5 → a2p2-0.7.7}/test/test_jmmc_catalog.py +0 -0
- {a2p2-0.7.5 → a2p2-0.7.7}/test/test_jmmc_models.py +0 -0
- {a2p2-0.7.5 → a2p2-0.7.7}/test/test_test.py +0 -0
@@ -26,6 +26,8 @@ class Catalog():
|
|
26
26
|
|
27
27
|
def __init__(self, catalogName, username=None, password=None, prod=False, apiUrl=None, tapUrl=None, where=None, joins=None):
|
28
28
|
self.catalogName = catalogName
|
29
|
+
self.updated = False
|
30
|
+
self.lastTable = None
|
29
31
|
self.where = where
|
30
32
|
self.joins = joins
|
31
33
|
self.prod = prod
|
@@ -91,13 +93,24 @@ class Catalog():
|
|
91
93
|
"""
|
92
94
|
return self.api._get(f"/{self.catalogName}/{id}")
|
93
95
|
|
94
|
-
def
|
96
|
+
def getDataFrame(self):
|
97
|
+
""" Get a pandas DataFrame from the main catalog joined the other if provided in constructor.
|
98
|
+
|
99
|
+
usage: cat.getDataFrame()
|
100
|
+
"""
|
101
|
+
|
102
|
+
return self.getTable().to_pandas()
|
103
|
+
|
104
|
+
def getTable(self, maxrec=10000, forceUpdate=False):
|
95
105
|
""" Get an astropy table from the main catalog joined the other if provided in constructor.
|
96
106
|
|
97
|
-
usage: cat.
|
107
|
+
usage: cat.getTable()
|
98
108
|
"""
|
99
109
|
# using SELECT TOP N below to workarround astroquery.utils.tap BUG
|
100
110
|
|
111
|
+
if not self.updated and self.lastTable and not forceUpdate:
|
112
|
+
return self.lastTable
|
113
|
+
|
101
114
|
clauses = []
|
102
115
|
if self.joins :
|
103
116
|
joinedCatalogNames = []
|
@@ -127,9 +140,10 @@ class Catalog():
|
|
127
140
|
clauses.append(f" WHERE {self.where}")
|
128
141
|
|
129
142
|
query = " ".join(clauses)
|
130
|
-
logger.info(f"
|
131
|
-
|
132
|
-
|
143
|
+
logger.info(f"Querying remote catalog : {query}")
|
144
|
+
self.lastTable = self.tap.search(query,maxrec=maxrec).to_table()
|
145
|
+
self.updated=False
|
146
|
+
return self.lastTable
|
133
147
|
|
134
148
|
def tableToDict(self, table):
|
135
149
|
""" Convert table (astropy.table or row) to a list of dict so we can modify content and update remote catalog using updateRows().
|
@@ -159,6 +173,7 @@ class Catalog():
|
|
159
173
|
|
160
174
|
usage: cat.updateRows(42, {"col_a":"a", "col_b":"b" })
|
161
175
|
"""
|
176
|
+
self.updated = True
|
162
177
|
return self.api._put(f"/{self.catalogName}/{id}", values)
|
163
178
|
|
164
179
|
def updateRows(self, values):
|
@@ -167,7 +182,7 @@ class Catalog():
|
|
167
182
|
|
168
183
|
usage: updateRows([ { "id":42, "col_a":"a" }, { "id":24, "col_b":"b" } ])
|
169
184
|
"""
|
170
|
-
|
185
|
+
self.updated = True
|
171
186
|
# We may check befere sending payload that we always provide an id for every record
|
172
187
|
# What is the behaviour if we provide various data assosiated to the same id ?
|
173
188
|
return self.api._put(f"/{self.catalogName}", values)
|
@@ -178,6 +193,7 @@ class Catalog():
|
|
178
193
|
|
179
194
|
usage: addCatalogRows([ { "id":42, "col_a":"a" }, { "id":24, "col_b":"b" } ])
|
180
195
|
"""
|
196
|
+
self.updated = True
|
181
197
|
return self.api._post(f"/{self.catalogName}", json=values)
|
182
198
|
|
183
199
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
__version__ = "0.7.
|
1
|
+
__version__ = "0.7.7"
|
2
2
|
|
3
3
|
__release_notes__ = {
|
4
4
|
# "0.1.6": {
|
@@ -23,7 +23,15 @@ __release_notes__ = {
|
|
23
23
|
# "Try to read OB in P2 and send them back to Aspro2 as a new obs",
|
24
24
|
# ],
|
25
25
|
|
26
|
-
"0.7.
|
26
|
+
"0.7.7": {
|
27
|
+
"A2P2": [
|
28
|
+
"save some data retrival until update or force request occurs",
|
29
|
+
],
|
30
|
+
},"0.7.6": {
|
31
|
+
"A2P2": [
|
32
|
+
"add getDataFrame() to a2p2.jmmc.Catalog to provide remote data with pandas format",
|
33
|
+
],
|
34
|
+
},"0.7.5": {
|
27
35
|
"A2P2": [
|
28
36
|
"Add support for join and filter in a2p2.jmmc.Catalog wrapper",
|
29
37
|
],
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|