cubevis 0.5.12__py3-none-any.whl → 0.5.13__py3-none-any.whl

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.

Potentially problematic release.


This version of cubevis might be problematic. Click here for more details.

cubevis/__version__.py CHANGED
@@ -1 +1 @@
1
- __version__ = '0.5.12'
1
+ __version__ = '0.5.13'
@@ -1,6 +1,6 @@
1
1
  ########################################################################
2
2
  #
3
- # Copyright (C) 2024
3
+ # Copyright (C) 2025
4
4
  # Associated Universities, Inc. Washington DC, USA.
5
5
  #
6
6
  # This script is free software; you can redistribute it and/or modify it
@@ -25,116 +25,6 @@
25
25
  # Charlottesville, VA 22903-2475 USA
26
26
  #
27
27
  ########################################################################
28
- '''casatasks provides on-the-fly creation of inp/go wrappers for tasks
29
- https://bayesianbrad.github.io/posts/2017_loader-finder-python.html
30
- '''
28
+ '''casatask equivalent bindings'''
31
29
 
32
- from importlib.abc import Loader as _Loader, MetaPathFinder as _MetaPathFinder
33
-
34
- import subprocess
35
- import re
36
- import os
37
- import sys
38
-
39
- class CasaTasks_Loader(_Loader):
40
-
41
- def __init__( self, java, jarpath, args, templ, xml ):
42
- self.__java = java
43
- self.__jarpath = jarpath
44
- self.__args = args
45
- self.__templ = templ
46
- self.__xml = xml
47
-
48
- def create_module(self, spec):
49
- return None
50
-
51
- def exec_module(self, module):
52
- python_source = subprocess.run( [ self.__java, '-jar', self.__jarpath ] + self.__args + [self.__templ, self.__xml], stdout=subprocess.PIPE ).stdout.decode('utf-8')
53
- exec( python_source, module.__dict__ )
54
-
55
-
56
- class CasaTasks_Finder(_MetaPathFinder):
57
-
58
- def __init__( self ):
59
- super(CasaTasks_Finder, self).__init__( )
60
- self.__java = None
61
- self.__source_dir = os.path.dirname(__file__)
62
- self.__jarpath = None
63
- self.__jarfile_name = "xml-casa-assembly-1.86.jar"
64
- self.__task_xml_files = None
65
-
66
- def __which( self, program ):
67
- def is_exe(fpath):
68
- return os.path.isfile(fpath) and os.access(fpath, os.X_OK)
69
-
70
- fpath, fname = os.path.split(program)
71
- if fpath:
72
- if is_exe(program):
73
- return os.path.realpath(program)
74
- else:
75
- os.environ.get("PATH", "")
76
- for path in os.environ.get("PATH", "").split(os.pathsep):
77
- exe_file = os.path.join(path, program)
78
- if is_exe(exe_file):
79
- return os.path.realpath(exe_file)
80
- return None
81
-
82
- def __find_parameters( self, taskname ):
83
- templ = os.path.join( self.__source_dir, f'''{taskname}.mustache''' )
84
- if os.path.isfile(templ):
85
- ### <TASK>.mustache exists -------------------------------------------------------------------------------------------------------------
86
- with open(templ) as f:
87
- header = [ (m.group(1), m.group(2), m.group(0)) for m in [ re.match( "^\#+\s*TASK XML\s*>\s*(\S+)(.*)", next(f) ) for _ in range(5) ] if m ]
88
- if len(header) == 1:
89
- ### <TASK>.mustache has processing specification line --------------------------------------------------------------------------
90
- task = os.path.splitext(header[0][0])[0]
91
- if task in self.__task_xml_files:
92
- ### <TASK>.mustache has processing specification line and includes valid CASA task name ------------------------------------
93
- return templ, self.__task_xml_files[task], header[0][1].split( )
94
- elif taskname in self.__task_xml_files:
95
- ### <TASK>.mustache has processing specification line and <TASK> is a valid CASA task --------------------------------------
96
- return templ, self.__task_xml_files[taskname], header[0][1].split( )
97
- elif taskname in self.__task_xml_files:
98
- ### <TASK>.mustache does not have a processing specification line but <TASK> is a valid CASA task-------------------------------
99
- return templ, self.__task_xml_files[taskname], [ ]
100
-
101
- if taskname in self.__task_xml_files:
102
- ### <TASK>.mustache does not exist but <TASK> is a valid CASA task ---------------------------------------------------------------------
103
- templ = os.path.join( self.__source_dir, f'''generic.mustache''' )
104
- if os.path.isfile(templ):
105
- ### <TASK> is a valid CASA task and generic.mustache exists ------------------------------------------------------------------------
106
- with open(templ) as f:
107
- header = [ (m.group(1), m.group(2), m.group(0)) for m in [ re.match( "^\#+\s*TASK XML\s*>\s*(\S+)(.*)", next(f) ) for _ in range(5) ] if m ]
108
- if len(header) == 1:
109
- ### <TASK> is a valid CASA task, generic.mustache exists and has a processing specification line ---------------------------
110
- return templ, self.__task_xml_files[taskname], header[0][1].split( )
111
- else:
112
- ### <TASK> is a valid CASA task, generic.mustache exists but does not have a processing specification line -----------------
113
- return templ, self.__task_xml_files[taskname], [ ]
114
-
115
- return None, None, [ ]
116
-
117
- def find_spec(self, fullname, path, target = None):
118
-
119
- if fullname.startswith('cubevis.private.casatasks.'):
120
- if self.__java is None:
121
- self.__java = self.__which( "java" )
122
- if self.__jarpath is None:
123
- p = os.path.join( os.path.dirname(os.path.dirname(__file__)), "__java__", self.__jarfile_name )
124
- if os.path.isfile(p):
125
- self.__jarpath = p
126
- if self.__task_xml_files is None:
127
- try:
128
- from casatasks import xml_interface_defs
129
- self.__task_xml_files = { k:v for (k,v) in xml_interface_defs( ).items( ) if os.path.isfile(v) }
130
- except: pass
131
-
132
- module = fullname.split(sep='.')[-1]
133
- templ, xml, args = self.__find_parameters( fullname.split(sep='.')[-1] )
134
- if templ is not None and xml is not None:
135
- from importlib.machinery import ModuleSpec
136
- return ModuleSpec( fullname, CasaTasks_Loader( self.__java, self.__jarpath, args, templ, xml ) )
137
-
138
- return None
139
-
140
- sys.meta_path.append(CasaTasks_Finder( ))
30
+ from .iclean import iclean
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: cubevis
3
- Version: 0.5.12
3
+ Version: 0.5.13
4
4
  Summary: visualization toolkit and apps for casa
5
5
  License: LGPL
6
6
  Author-email: Darrell Schiebel <darrell@schiebel.us>,Pam Harris <pharris@nrao.edu>
@@ -88,7 +88,6 @@ cubevis/plot/ms_plot/_ms_plot_selectors.py,sha256=bus0R6R8BNS6Y2dMxVngf6v54AIZTd
88
88
  cubevis/plot/ms_plot/_raster_plot.py,sha256=OtEDX5cjNZ65Wn1vB8vTxEr1JZejyXgE9nW_liUNAwc,12958
89
89
  cubevis/plot/ms_plot/_raster_plot_inputs.py,sha256=yUFob7t4JMXTwHjzNWZMEMLCvQdJ55SyWj3mZBxHgos,5173
90
90
  cubevis/plot/ms_plot/_xds_plot_axes.py,sha256=EeWvAbiKV33nEWdI8V3M0uwLTnycq4bFYBOyVWkxCu0,4429
91
- cubevis/private/__java__/xml-casa-assembly-1.86.jar,sha256=dBT_OxPtczAfWKRaOrHWwNZbDfEjtKkuQGuFOaKOczA,8041045
92
91
  cubevis/private/_gclean.py,sha256=ExdR6cRxSa6Xne2veGNKhbTtx-tXUIWr2htzEmEZ9Z4,41107
93
92
  cubevis/private/apps/__init__.py,sha256=-9U6o-SClwJolGDnFhlH1au4tz-w4HgRcyT4_OQ_Z7E,2510
94
93
  cubevis/private/apps/_createmask.py,sha256=bKFpME5MYhLh7HxlJZINBTwG25t0_T_d1nYrWYAWYPA,23527
@@ -101,7 +100,7 @@ cubevis/private/apps/_plotants.py,sha256=top6VWVd_sE48IVPH_sIg3_sQeDl5tadi5DL7r5
101
100
  cubevis/private/apps/_plotbandpass.py,sha256=NwOgKSRnpLw9Pt3KIdBpoV78q1OnjCvj6lWFqeyICt8,185
102
101
  cubevis/private/casashell/createmask.py,sha256=C1eSUUsttSGghjZ5aDUVhRxnjir5MlYXVyxzEYLcI3k,14457
103
102
  cubevis/private/casashell/iclean.py,sha256=FUrCMrfXuTjUHFBA0PVEctDXlHsZrMZBePwZ_otDwxI,294787
104
- cubevis/private/casatasks/__init__.py,sha256=yLL13GDxSxIkqjjap_sJO_aGVaBUW9gXMwlAlPli97g,6963
103
+ cubevis/private/casatasks/__init__.py,sha256=Uzt9uNiTl0ORavzuoIDJ8gfYUhdWwAAj1D2VJ3wAvvQ,1333
105
104
  cubevis/private/casatasks/createmask.py,sha256=qtp8IvFCB1BG2pqRbyP8CmTr-RRqLMBSjMIO86mZ7WA,3770
106
105
  cubevis/private/casatasks/createregion.py,sha256=f2KIrkbbdczZk3EHd3x9ZTUaewdjSxlRge-Es8BivNk,3355
107
106
  cubevis/private/casatasks/iclean.py,sha256=YO9RRtWVD3MxizqxTB-7yPD8NkX-mvbsB2yTyRcrvT0,152997
@@ -126,8 +125,8 @@ cubevis/utils/_pkgs.py,sha256=mu2CCzndmJZYP81UkFhxveW_CisWLUvagJVolHOEVgM,2294
126
125
  cubevis/utils/_regions.py,sha256=TdAg4ZUUyhg3nFmX9_KLboqmc0LkyOdEW8M1WDR5Udk,1669
127
126
  cubevis/utils/_static.py,sha256=rN-sqXNqQ5R2M3wmPHU1GPP5OTyyWQlUPRuimCrht-g,2347
128
127
  cubevis/utils/_tiles.py,sha256=A9W1X61VOhBMTOKXVajzOIoiV2FBdO5N2SFB9SUpDOo,7336
129
- cubevis/__version__.py,sha256=z3x2AegQWLToL5yMcS7dHEto7D9XUa4VzCOqg91RCYc,22
130
- cubevis-0.5.12.dist-info/WHEEL,sha256=B19PGBCYhWaz2p_UjAoRVh767nYQfk14Sn4TpIZ-nfU,87
131
- cubevis-0.5.12.dist-info/METADATA,sha256=kKWypQp_9ty8BR68rOpj6EW27-GHplOvNgmBqcDX9hA,2629
132
- cubevis-0.5.12.dist-info/licenses/LICENSE,sha256=IMF9i4xIpgCADf0U-V1cuf9HBmqWQd3qtI3FSuyW4zE,26526
133
- cubevis-0.5.12.dist-info/RECORD,,
128
+ cubevis/__version__.py,sha256=OYo7Ah0wICBCFc4dNdr54AMBYTK_lp1kbfjO8-QZR9E,22
129
+ cubevis-0.5.13.dist-info/WHEEL,sha256=B19PGBCYhWaz2p_UjAoRVh767nYQfk14Sn4TpIZ-nfU,87
130
+ cubevis-0.5.13.dist-info/METADATA,sha256=M40RMt0Lxgq23-vGyqIEYLW_sdbUhzTPkf_N8pHxUpI,2629
131
+ cubevis-0.5.13.dist-info/licenses/LICENSE,sha256=IMF9i4xIpgCADf0U-V1cuf9HBmqWQd3qtI3FSuyW4zE,26526
132
+ cubevis-0.5.13.dist-info/RECORD,,