a2p2 0.7.2__tar.gz → 0.7.4__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.2/a2p2.egg-info → a2p2-0.7.4}/PKG-INFO +18 -9
- {a2p2-0.7.2 → a2p2-0.7.4}/README.rst +3 -0
- a2p2-0.7.4/a2p2/chara/facility.py +83 -0
- {a2p2-0.7.2 → a2p2-0.7.4}/a2p2/version.py +26 -34
- {a2p2-0.7.2 → a2p2-0.7.4}/a2p2/vlti/facility.py +9 -2
- {a2p2-0.7.2 → a2p2-0.7.4}/a2p2/vlti/pionier.py +0 -3
- {a2p2-0.7.2 → a2p2-0.7.4/a2p2.egg-info}/PKG-INFO +18 -9
- {a2p2-0.7.2 → a2p2-0.7.4}/a2p2.egg-info/SOURCES.txt +1 -0
- {a2p2-0.7.2 → a2p2-0.7.4}/a2p2.egg-info/entry_points.txt +0 -1
- a2p2-0.7.4/pyproject.toml +43 -0
- a2p2-0.7.4/setup.py +19 -0
- a2p2-0.7.2/a2p2/chara/facility.py +0 -68
- a2p2-0.7.2/setup.py +0 -44
- {a2p2-0.7.2 → a2p2-0.7.4}/LICENSE +0 -0
- {a2p2-0.7.2 → a2p2-0.7.4}/MANIFEST.in +0 -0
- {a2p2-0.7.2 → a2p2-0.7.4}/a2p2/__init__.py +0 -0
- {a2p2-0.7.2 → a2p2-0.7.4}/a2p2/__main__.py +0 -0
- {a2p2-0.7.2 → a2p2-0.7.4}/a2p2/chara/__init__.py +0 -0
- {a2p2-0.7.2 → a2p2-0.7.4}/a2p2/chara/gui.py +0 -0
- {a2p2-0.7.2 → a2p2-0.7.4}/a2p2/client.py +0 -0
- {a2p2-0.7.2 → a2p2-0.7.4}/a2p2/facility.py +0 -0
- {a2p2-0.7.2 → a2p2-0.7.4}/a2p2/gui.py +0 -0
- {a2p2-0.7.2 → a2p2-0.7.4}/a2p2/instrument.py +0 -0
- {a2p2-0.7.2 → a2p2-0.7.4}/a2p2/jmmc/__init__.py +0 -0
- {a2p2-0.7.2 → a2p2-0.7.4}/a2p2/jmmc/catalogs.py +0 -0
- {a2p2-0.7.2 → a2p2-0.7.4}/a2p2/jmmc/generated_models.py +0 -0
- {a2p2-0.7.2 → a2p2-0.7.4}/a2p2/jmmc/models.py +0 -0
- {a2p2-0.7.2 → a2p2-0.7.4}/a2p2/jmmc/services.py +0 -0
- {a2p2-0.7.2 → a2p2-0.7.4}/a2p2/jmmc/utils.py +0 -0
- {a2p2-0.7.2 → a2p2-0.7.4}/a2p2/jmmc/webservices.py +0 -0
- {a2p2-0.7.2 → a2p2-0.7.4}/a2p2/ob.py +0 -0
- {a2p2-0.7.2 → a2p2-0.7.4}/a2p2/samp.py +0 -0
- {a2p2-0.7.2 → a2p2-0.7.4}/a2p2/utils.py +0 -0
- {a2p2-0.7.2 → a2p2-0.7.4}/a2p2/vlti/__init__.py +0 -0
- {a2p2-0.7.2 → a2p2-0.7.4}/a2p2/vlti/conf/GRAVITY_ditTable.json +0 -0
- {a2p2-0.7.2 → a2p2-0.7.4}/a2p2/vlti/conf/GRAVITY_rangeTable.json +0 -0
- {a2p2-0.7.2 → a2p2-0.7.4}/a2p2/vlti/conf/MATISSE_ditTable.json +0 -0
- {a2p2-0.7.2 → a2p2-0.7.4}/a2p2/vlti/conf/MATISSE_rangeTable.json +0 -0
- {a2p2-0.7.2 → a2p2-0.7.4}/a2p2/vlti/conf/PIONIER_ditTable.json +0 -0
- {a2p2-0.7.2 → a2p2-0.7.4}/a2p2/vlti/conf/PIONIER_rangeTable.json +0 -0
- {a2p2-0.7.2 → a2p2-0.7.4}/a2p2/vlti/gravity.py +0 -0
- {a2p2-0.7.2 → a2p2-0.7.4}/a2p2/vlti/gui.py +0 -0
- {a2p2-0.7.2 → a2p2-0.7.4}/a2p2/vlti/instrument.py +0 -0
- {a2p2-0.7.2 → a2p2-0.7.4}/a2p2/vlti/matisse.py +0 -0
- {a2p2-0.7.2 → a2p2-0.7.4}/a2p2.egg-info/dependency_links.txt +0 -0
- {a2p2-0.7.2 → a2p2-0.7.4}/a2p2.egg-info/requires.txt +1 -1
- {a2p2-0.7.2 → a2p2-0.7.4}/a2p2.egg-info/top_level.txt +0 -0
- {a2p2-0.7.2 → a2p2-0.7.4}/setup.cfg +0 -0
- {a2p2-0.7.2 → a2p2-0.7.4}/test/test_jmmc_catalog.py +0 -0
- {a2p2-0.7.2 → a2p2-0.7.4}/test/test_jmmc_models.py +0 -0
- {a2p2-0.7.2 → a2p2-0.7.4}/test/test_test.py +0 -0
@@ -1,19 +1,27 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: a2p2
|
3
|
-
Version: 0.7.
|
4
|
-
|
5
|
-
Home-page: http://www.jmmc.fr/a2p2
|
6
|
-
Author: JMMC Tech Group
|
7
|
-
Author-email: jmmc-tech-group@jmmc.fr
|
3
|
+
Version: 0.7.4
|
4
|
+
Author-email: JMMC Tech Group <jmmc-tech-group@jmmc.fr>
|
8
5
|
License: OSI Approved :: GNU General Public License v3 (GPLv3)
|
9
|
-
|
10
|
-
|
6
|
+
Project-URL: Homepage, https://www.jmmc.fr/a2p2
|
7
|
+
Project-URL: Bug Reports, https://github.com/JMMC-OpenDev/a2p2/issues
|
8
|
+
Project-URL: Source, https://github.com/JMMC-OpenDev/a2p2
|
9
|
+
Keywords: observation,optical-interferometry,p2,preparation,samp,tool
|
11
10
|
Classifier: Development Status :: 4 - Beta
|
12
11
|
Classifier: Intended Audience :: Developers
|
13
12
|
Classifier: Programming Language :: Python :: 3
|
14
13
|
Classifier: Programming Language :: Python :: 3.6
|
15
14
|
Requires-Python: >=3
|
15
|
+
Description-Content-Type: text/x-rst
|
16
16
|
License-File: LICENSE
|
17
|
+
Requires-Dist: appdirs
|
18
|
+
Requires-Dist: astropy>=5.2.2
|
19
|
+
Requires-Dist: p2api
|
20
|
+
|
21
|
+
a2p2 |A2P2Badge|
|
22
|
+
================
|
23
|
+
|
24
|
+
**Move your Aspro2 observation details to an observatory proposal database.**
|
17
25
|
|
18
26
|
Description
|
19
27
|
-----------
|
@@ -80,6 +88,9 @@ Each facilities get it's own code directory to manage specific GUI and specific
|
|
80
88
|
|
81
89
|
Please fill an issue_ for any question, remark or enhancement request.
|
82
90
|
|
91
|
+
Release notes
|
92
|
+
-------------
|
93
|
+
`Check file <release-notes.md>`_
|
83
94
|
|
84
95
|
License
|
85
96
|
-------
|
@@ -110,5 +121,3 @@ Interaction diagram
|
|
110
121
|
.. _a2p2: http://www.jmmc.fr/a2p2
|
111
122
|
.. _tutorial: https://github.com/JMMC-OpenDev/a2p2/wiki/ASPRO2-A2P2-Tutorial
|
112
123
|
.. _issue: https://github.com/JMMC-OpenDev/a2p2/issues
|
113
|
-
|
114
|
-
|
@@ -0,0 +1,83 @@
|
|
1
|
+
#!/usr/bin/env python
|
2
|
+
|
3
|
+
__all__ = []
|
4
|
+
|
5
|
+
from a2p2.chara.gui import CharaUI
|
6
|
+
from a2p2.facility import Facility
|
7
|
+
import requests
|
8
|
+
import logging
|
9
|
+
import traceback
|
10
|
+
|
11
|
+
HELPTEXT = "TODO update this HELP message in a2p2/chara/facility.py"
|
12
|
+
|
13
|
+
logger = logging.getLogger(__name__)
|
14
|
+
|
15
|
+
class CharaFacility(Facility):
|
16
|
+
|
17
|
+
def __init__(self, a2p2client):
|
18
|
+
Facility.__init__(self, a2p2client, "CHARA", HELPTEXT)
|
19
|
+
self.charaUI = CharaUI(self)
|
20
|
+
self.connected2OB2 = False
|
21
|
+
self.validQueueServer = None
|
22
|
+
|
23
|
+
def processOB(self, ob):
|
24
|
+
if not ob:
|
25
|
+
return
|
26
|
+
|
27
|
+
self.a2p2client.ui.addToLog(
|
28
|
+
"OB received for '" + self.facilityName + "' interferometer")
|
29
|
+
# show ob dict for debug
|
30
|
+
self.a2p2client.ui.addToLog(str(ob), False)
|
31
|
+
|
32
|
+
# performs operation
|
33
|
+
self.consumeOB(ob)
|
34
|
+
|
35
|
+
# give focus on last updated UI
|
36
|
+
self.a2p2client.ui.showFacilityUI(self.charaUI)
|
37
|
+
|
38
|
+
def checkServer(self):
|
39
|
+
if self.validQueueServer:
|
40
|
+
# recheck ?
|
41
|
+
return True
|
42
|
+
else:
|
43
|
+
# search and test servers from preferences
|
44
|
+
queueServers=self.a2p2client.preferences.getCharaQueueServer()
|
45
|
+
msg=""
|
46
|
+
if queueServers :
|
47
|
+
for queueServer in queueServers:
|
48
|
+
logger.debug(f'Trying to send OB on queuserver : {queueServer}')
|
49
|
+
try:
|
50
|
+
c=requests.get(queueServer, timeout=3)
|
51
|
+
msg+=f"Connection succeeded on OB server : {c.json()}\n"
|
52
|
+
self.validQueueServer = queueServer
|
53
|
+
break
|
54
|
+
except:
|
55
|
+
msg+=f"Connection failed on {queueServer}\n"
|
56
|
+
|
57
|
+
self.a2p2client.ui.addToLog(msg)
|
58
|
+
self.charaUI.display(msg)
|
59
|
+
|
60
|
+
return self.validQueueServer
|
61
|
+
|
62
|
+
def consumeOB(self, ob):
|
63
|
+
if self.checkServer():
|
64
|
+
try:
|
65
|
+
r = requests.post(self.validQueueServer, json=ob.as_dict(), timeout=3)
|
66
|
+
msg = ""
|
67
|
+
msg+=f"OB sent to remote server queue : {r}"
|
68
|
+
self.connected2OB2 = True
|
69
|
+
self.a2p2client.ui.addToLog(msg)
|
70
|
+
self.charaUI.display(msg)
|
71
|
+
except:
|
72
|
+
print(traceback.format_exc())
|
73
|
+
msg=f"Can't send OB to the '{self.validQueueServer}' queue server, please relaunch it or try again for a new one."
|
74
|
+
self.validQueueServer = None
|
75
|
+
self.a2p2client.ui.addToLog(msg)
|
76
|
+
self.charaUI.display(msg)
|
77
|
+
else:
|
78
|
+
msg=f"Can't find any queue server, please launch it, edit your preferences or check your ssh port forwarding"
|
79
|
+
|
80
|
+
# display OB
|
81
|
+
self.charaUI.displayOB(ob)
|
82
|
+
|
83
|
+
|
@@ -1,29 +1,39 @@
|
|
1
|
-
__version__ = "0.7.
|
1
|
+
__version__ = "0.7.4"
|
2
2
|
|
3
3
|
__release_notes__ = {
|
4
4
|
# "0.1.6": {
|
5
|
-
# "STATUS":[
|
6
|
-
# "This version get lot of changes and may contain bugs or missing features, please provide any feedback to improve and prepare a better future release !"
|
7
|
-
# ],
|
8
5
|
# "A2P2": [
|
9
|
-
#
|
10
6
|
# ],
|
11
7
|
# "VLTI": [
|
12
|
-
#
|
13
8
|
# ],
|
14
9
|
# "CHARA": [
|
15
|
-
#
|
16
|
-
# ],
|
17
|
-
# "TODO-SCIENCE": [
|
18
|
-
#
|
19
|
-
# ],
|
20
|
-
# "TODO-DEV": [
|
21
|
-
#
|
22
10
|
# ],
|
23
11
|
# },
|
24
|
-
|
25
|
-
"
|
12
|
+
#
|
13
|
+
# "TODO-SCIENCE": [
|
14
|
+
# "Merge AO or GS in a same code section for every instruments",
|
15
|
+
# "Check DIT table from the last template user manuals (especially MATISSE) and remove PIONIER's one",
|
16
|
+
# "flag ~important~ keywords which MUST be set in a2p2 code and not leaved to there default values?",
|
17
|
+
# ],
|
18
|
+
# "TODO-DEV": [
|
19
|
+
# "Support multiple period version (two major at least)",
|
20
|
+
# "Support numlist keyword : eg. SEQ.HWPOFF (done in conf but must be range check compatible)",
|
21
|
+
# "Unify ob name creation in vlti instrument createOB()",
|
22
|
+
# "Complete test suite with more real p2 submissions",
|
23
|
+
# "Try to read OB in P2 and send them back to Aspro2 as a new obs",
|
24
|
+
# ],
|
25
|
+
|
26
|
+
"0.7.4": {
|
27
|
+
"A2P2": [
|
28
|
+
"Use pyproject.toml for python installation",
|
29
|
+
],"VLTI": [
|
30
|
+
"Do not switch PIONIER mode to FREE when the magnitude of the IAS star is too high : an error may be provided by p2"
|
31
|
+
],
|
32
|
+
},"0.7.3": {
|
33
|
+
"CHARA": [
|
34
|
+
"Better reuse of last working queueserver"
|
26
35
|
],
|
36
|
+
},"0.7.2": {
|
27
37
|
"A2P2": [
|
28
38
|
"Auto update chara queueserver preference",
|
29
39
|
"a2p2 -r generates release-notes.md (rendered on a2p2 repository)"
|
@@ -34,21 +44,7 @@ __release_notes__ = {
|
|
34
44
|
"CHARA": [
|
35
45
|
"Support and try every queueserver's Urls comma separated from the queuserver user preference"
|
36
46
|
],
|
37
|
-
"TODO-SCIENCE": [
|
38
|
-
"Merge AO or GS in a same code section for every instruments",
|
39
|
-
"Check DIT table from the last template user manuals (especially MATISSE) and remove PIONIER's one",
|
40
|
-
"flag ~important~ keywords which MUST be set in a2p2 code and not leaved to there default values?",
|
41
|
-
],
|
42
|
-
"TODO-DEV": [
|
43
|
-
"Support multiple period version (two major at least)",
|
44
|
-
"Support numlist keyword : eg. SEQ.HWPOFF (done in conf but must be range check compatible)",
|
45
|
-
"Unify ob name creation in vlti instrument createOB()",
|
46
|
-
"Complete test suite with more real p2 submissions",
|
47
|
-
"Try to read OB in P2 and send them back to Aspro2 as a new obs",
|
48
|
-
],
|
49
47
|
},"0.7.1": {
|
50
|
-
"STATUS": [
|
51
|
-
],
|
52
48
|
"A2P2": [
|
53
49
|
"Fix ttk import on MacOS",
|
54
50
|
],
|
@@ -61,8 +57,6 @@ __release_notes__ = {
|
|
61
57
|
"Display log of received OB also for calibrators"
|
62
58
|
]
|
63
59
|
},"0.6.9": {
|
64
|
-
"STATUS": [
|
65
|
-
],
|
66
60
|
"A2P2": [
|
67
61
|
"ctrl-c support improved to qui a2p2 from terminal",
|
68
62
|
],
|
@@ -90,8 +84,6 @@ __release_notes__ = {
|
|
90
84
|
"Experimental: forward OBs through json payload to the location defined in preference",
|
91
85
|
],
|
92
86
|
},"0.6.4": {
|
93
|
-
"STATUS": [
|
94
|
-
],
|
95
87
|
"A2P2": [
|
96
88
|
"Fix import that may break run on windows..."
|
97
89
|
],
|
@@ -234,7 +226,7 @@ __release_notes__ = {
|
|
234
226
|
],
|
235
227
|
},
|
236
228
|
"0.2.14": {
|
237
|
-
"
|
229
|
+
"A2P2": [
|
238
230
|
"BugFix: ask for container Name only if one is selected"
|
239
231
|
],
|
240
232
|
},
|
@@ -191,10 +191,17 @@ class VltiFacility(Facility):
|
|
191
191
|
instrument = self.getInstrument(o.instrumentConfiguration.name)
|
192
192
|
instrument.checkOB(o)
|
193
193
|
# check for warnings and abort if requested by user
|
194
|
+
# this implementation should be more detailled so we can have various VERSION associated to various warning
|
194
195
|
if len(instrument.warnings)>0:
|
195
196
|
linesep="\n - "
|
196
|
-
|
197
|
-
|
197
|
+
header=""
|
198
|
+
try:
|
199
|
+
# some ditTable may have a VERSION entry some not...
|
200
|
+
version=instrument.getDitTable()["VERSION"]
|
201
|
+
header= f"According to the template manual {version} :\n \n - \n"
|
202
|
+
except:
|
203
|
+
pass
|
204
|
+
answer = self.ui.AskYesNoMessage(f"{header} {linesep.join(instrument.warnings)}\n\nClick \"Yes\" to proceed \"No\" to abort the submission")
|
198
205
|
instrument.warnings.clear()
|
199
206
|
if answer == False:
|
200
207
|
self.ui.addToLog("Submission has been marked to be aborted - do not proceed")
|
@@ -124,9 +124,6 @@ class Pionier(VltiInstrument):
|
|
124
124
|
else:
|
125
125
|
obConstraints.skyTransparency = 'Clear'
|
126
126
|
|
127
|
-
if acqTSF.ISS_IAS_HMAG > 7.5:
|
128
|
-
acqTSF.INS_DISP_NAME = "FREE"
|
129
|
-
|
130
127
|
# FIXME: error (OB): "Phase 2 constraints must closely follow what was requested in the Phase 1 proposal.
|
131
128
|
# The seeing value allowed for this OB is >= java0x0 arcsec."
|
132
129
|
# FIXME REPLACE SEEING THAT IS NO MORE SUPPORTED
|
@@ -1,19 +1,27 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: a2p2
|
3
|
-
Version: 0.7.
|
4
|
-
|
5
|
-
Home-page: http://www.jmmc.fr/a2p2
|
6
|
-
Author: JMMC Tech Group
|
7
|
-
Author-email: jmmc-tech-group@jmmc.fr
|
3
|
+
Version: 0.7.4
|
4
|
+
Author-email: JMMC Tech Group <jmmc-tech-group@jmmc.fr>
|
8
5
|
License: OSI Approved :: GNU General Public License v3 (GPLv3)
|
9
|
-
|
10
|
-
|
6
|
+
Project-URL: Homepage, https://www.jmmc.fr/a2p2
|
7
|
+
Project-URL: Bug Reports, https://github.com/JMMC-OpenDev/a2p2/issues
|
8
|
+
Project-URL: Source, https://github.com/JMMC-OpenDev/a2p2
|
9
|
+
Keywords: observation,optical-interferometry,p2,preparation,samp,tool
|
11
10
|
Classifier: Development Status :: 4 - Beta
|
12
11
|
Classifier: Intended Audience :: Developers
|
13
12
|
Classifier: Programming Language :: Python :: 3
|
14
13
|
Classifier: Programming Language :: Python :: 3.6
|
15
14
|
Requires-Python: >=3
|
15
|
+
Description-Content-Type: text/x-rst
|
16
16
|
License-File: LICENSE
|
17
|
+
Requires-Dist: appdirs
|
18
|
+
Requires-Dist: astropy>=5.2.2
|
19
|
+
Requires-Dist: p2api
|
20
|
+
|
21
|
+
a2p2 |A2P2Badge|
|
22
|
+
================
|
23
|
+
|
24
|
+
**Move your Aspro2 observation details to an observatory proposal database.**
|
17
25
|
|
18
26
|
Description
|
19
27
|
-----------
|
@@ -80,6 +88,9 @@ Each facilities get it's own code directory to manage specific GUI and specific
|
|
80
88
|
|
81
89
|
Please fill an issue_ for any question, remark or enhancement request.
|
82
90
|
|
91
|
+
Release notes
|
92
|
+
-------------
|
93
|
+
`Check file <release-notes.md>`_
|
83
94
|
|
84
95
|
License
|
85
96
|
-------
|
@@ -110,5 +121,3 @@ Interaction diagram
|
|
110
121
|
.. _a2p2: http://www.jmmc.fr/a2p2
|
111
122
|
.. _tutorial: https://github.com/JMMC-OpenDev/a2p2/wiki/ASPRO2-A2P2-Tutorial
|
112
123
|
.. _issue: https://github.com/JMMC-OpenDev/a2p2/issues
|
113
|
-
|
114
|
-
|
@@ -0,0 +1,43 @@
|
|
1
|
+
[build-system]
|
2
|
+
requires = ["setuptools"]
|
3
|
+
build-backend = "setuptools.build_meta"
|
4
|
+
|
5
|
+
[project]
|
6
|
+
name = "a2p2"
|
7
|
+
dynamic = ["version", "description"]
|
8
|
+
#version = "1.2.3"
|
9
|
+
#description = ["description"]
|
10
|
+
readme = "README.rst"
|
11
|
+
license = { "text" = "OSI Approved :: GNU General Public License v3 (GPLv3)" }
|
12
|
+
requires-python = ">=3"
|
13
|
+
authors = [
|
14
|
+
{ name = "JMMC Tech Group", email = "jmmc-tech-group@jmmc.fr" },
|
15
|
+
]
|
16
|
+
keywords = [
|
17
|
+
"observation",
|
18
|
+
"optical-interferometry",
|
19
|
+
"p2",
|
20
|
+
"preparation",
|
21
|
+
"samp",
|
22
|
+
"tool",
|
23
|
+
]
|
24
|
+
classifiers = [
|
25
|
+
"Development Status :: 4 - Beta",
|
26
|
+
"Intended Audience :: Developers",
|
27
|
+
"Programming Language :: Python :: 3",
|
28
|
+
"Programming Language :: Python :: 3.6",
|
29
|
+
]
|
30
|
+
dependencies = [
|
31
|
+
"appdirs",
|
32
|
+
"astropy>=5.2.2",
|
33
|
+
"p2api",
|
34
|
+
]
|
35
|
+
|
36
|
+
[project.scripts]
|
37
|
+
a2p2 = "a2p2.__main__:main"
|
38
|
+
|
39
|
+
[project.urls]
|
40
|
+
Homepage = "https://www.jmmc.fr/a2p2"
|
41
|
+
"Bug Reports" = "https://github.com/JMMC-OpenDev/a2p2/issues"
|
42
|
+
Source = "https://github.com/JMMC-OpenDev/a2p2"
|
43
|
+
|
a2p2-0.7.4/setup.py
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
from setuptools import setup, find_packages
|
2
|
+
|
3
|
+
with open('README.rst') as README:
|
4
|
+
long_description = README.read()
|
5
|
+
description = long_description[
|
6
|
+
:long_description.index('Description')].split("*")[1].strip()
|
7
|
+
|
8
|
+
versions = {}
|
9
|
+
with open("a2p2/version.py") as fp:
|
10
|
+
exec(fp.read(), versions)
|
11
|
+
|
12
|
+
setup(
|
13
|
+
version=versions['__version__'],
|
14
|
+
description=description
|
15
|
+
# not yet moved to pyproject.toml
|
16
|
+
# packages=find_packages(),
|
17
|
+
# include_package_data=True,
|
18
|
+
# keywords='observation preparation tool optical-interferometry p2 samp'
|
19
|
+
)
|
@@ -1,68 +0,0 @@
|
|
1
|
-
#!/usr/bin/env python
|
2
|
-
|
3
|
-
__all__ = []
|
4
|
-
|
5
|
-
from a2p2.chara.gui import CharaUI
|
6
|
-
from a2p2.facility import Facility
|
7
|
-
import requests
|
8
|
-
import logging
|
9
|
-
import traceback
|
10
|
-
|
11
|
-
HELPTEXT = "TODO update this HELP message in a2p2/chara/facility.py"
|
12
|
-
|
13
|
-
logger = logging.getLogger(__name__)
|
14
|
-
|
15
|
-
class CharaFacility(Facility):
|
16
|
-
|
17
|
-
def __init__(self, a2p2client):
|
18
|
-
Facility.__init__(self, a2p2client, "CHARA", HELPTEXT)
|
19
|
-
self.charaUI = CharaUI(self)
|
20
|
-
self.connected2OB2 = False
|
21
|
-
|
22
|
-
def processOB(self, ob):
|
23
|
-
if not ob:
|
24
|
-
return
|
25
|
-
|
26
|
-
self.a2p2client.ui.addToLog(
|
27
|
-
"OB received for '" + self.facilityName + "' interferometer")
|
28
|
-
# show ob dict for debug
|
29
|
-
self.a2p2client.ui.addToLog(str(ob), False)
|
30
|
-
|
31
|
-
# performs operation
|
32
|
-
self.consumeOB(ob)
|
33
|
-
|
34
|
-
# give focus on last updated UI
|
35
|
-
self.a2p2client.ui.showFacilityUI(self.charaUI)
|
36
|
-
|
37
|
-
def consumeOB(self, ob):
|
38
|
-
# forward message if a server is present in the preferences
|
39
|
-
queueServers=self.a2p2client.preferences.getCharaQueueServer()
|
40
|
-
if queueServers :
|
41
|
-
for queueServer in queueServers:
|
42
|
-
logger.debug(f'Trying to send OB on queuserver : {queueServer}')
|
43
|
-
try:
|
44
|
-
if not self.connected2OB2:
|
45
|
-
try:
|
46
|
-
c=requests.get(queueServer, timeout=5)
|
47
|
-
msg += f"Connection succeeded on OB2 server : {c.json()}\n"
|
48
|
-
except:
|
49
|
-
msg += f"Connection succeded on a non identified OB2 server\n"
|
50
|
-
r = requests.post(queueServer, json=ob.as_dict(), timeout=5)
|
51
|
-
msg = ""
|
52
|
-
msg+=f"OB sent to remote server queue : {r}"
|
53
|
-
self.connected2OB2 = True
|
54
|
-
self.a2p2client.ui.addToLog(msg)
|
55
|
-
self.charaUI.display(msg)
|
56
|
-
break # do only send to the first server
|
57
|
-
except:
|
58
|
-
print(traceback.format_exc())
|
59
|
-
msg=f"Can't send OB to the '{queueServer}' queue server, please launch it, edit your preferences or check your ssh port forwarding "
|
60
|
-
self.connected2OB2 = False
|
61
|
-
self.a2p2client.ui.addToLog(msg)
|
62
|
-
self.charaUI.display(msg)
|
63
|
-
|
64
|
-
|
65
|
-
# display OB
|
66
|
-
self.charaUI.displayOB(ob)
|
67
|
-
|
68
|
-
|
a2p2-0.7.2/setup.py
DELETED
@@ -1,44 +0,0 @@
|
|
1
|
-
from setuptools import setup, find_packages
|
2
|
-
|
3
|
-
with open('README.rst') as README:
|
4
|
-
long_description = README.read()
|
5
|
-
description = long_description[
|
6
|
-
:long_description.index('Description')].split("*")[1].strip()
|
7
|
-
long_description = long_description[long_description.index('Description'):]
|
8
|
-
|
9
|
-
version = {}
|
10
|
-
with open("a2p2/version.py") as fp:
|
11
|
-
exec(fp.read(), version)
|
12
|
-
|
13
|
-
setup(
|
14
|
-
name='a2p2',
|
15
|
-
version=version['__version__'],
|
16
|
-
python_requires='>=3',
|
17
|
-
description=description,
|
18
|
-
long_description=long_description,
|
19
|
-
# install_requires=['astropy', 'p2api','pygtk'],
|
20
|
-
# PyGtk is not working on some linux
|
21
|
-
# anaconda also fails
|
22
|
-
# prefere the use of your default python packages on your linux
|
23
|
-
# what is the solution for mac ?
|
24
|
-
# we continue moving tk as first gui backend
|
25
|
-
# install_requires=['astropy', 'p2api', 'python-tk'] + (['pygtk'] if
|
26
|
-
# platform.startswith("win") else []),
|
27
|
-
install_requires=['astropy>=5.2.2', 'p2api', 'appdirs'],
|
28
|
-
url='http://www.jmmc.fr/a2p2',
|
29
|
-
author='JMMC Tech Group',
|
30
|
-
author_email='jmmc-tech-group@jmmc.fr',
|
31
|
-
classifiers=[
|
32
|
-
'Development Status :: 4 - Beta',
|
33
|
-
'Intended Audience :: Developers',
|
34
|
-
# 'Programming Language :: Python :: 2',
|
35
|
-
# 'Programming Language :: Python :: 2.7',
|
36
|
-
'Programming Language :: Python :: 3',
|
37
|
-
'Programming Language :: Python :: 3.6',
|
38
|
-
],
|
39
|
-
license='OSI Approved :: GNU General Public License v3 (GPLv3)',
|
40
|
-
packages=find_packages(),
|
41
|
-
include_package_data=True,
|
42
|
-
entry_points={'console_scripts': ['a2p2=a2p2.__main__:main']},
|
43
|
-
keywords='observation preparation tool optical-interferometry p2 samp'
|
44
|
-
)
|
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
|