casaconfig 0.0.70__tar.gz → 0.0.71__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.
Files changed (33) hide show
  1. {casaconfig-0.0.70/casaconfig.egg-info → casaconfig-0.0.71}/PKG-INFO +1 -1
  2. {casaconfig-0.0.70 → casaconfig-0.0.71}/casaconfig/__main__.py +2 -2
  3. {casaconfig-0.0.70 → casaconfig-0.0.71}/casaconfig/config.py +3 -3
  4. {casaconfig-0.0.70 → casaconfig-0.0.71}/casaconfig/private/config_defaults_static.py +3 -3
  5. {casaconfig-0.0.70 → casaconfig-0.0.71}/casaconfig/private/data_update.py +12 -11
  6. casaconfig-0.0.71/casaconfig/private/get_config.py +20 -0
  7. {casaconfig-0.0.70 → casaconfig-0.0.71}/casaconfig/private/get_data_info.py +5 -5
  8. {casaconfig-0.0.70 → casaconfig-0.0.71}/casaconfig/private/measures_update.py +19 -11
  9. {casaconfig-0.0.70 → casaconfig-0.0.71}/casaconfig/private/pull_data.py +5 -5
  10. {casaconfig-0.0.70 → casaconfig-0.0.71/casaconfig.egg-info}/PKG-INFO +1 -1
  11. {casaconfig-0.0.70 → casaconfig-0.0.71}/setup.py +1 -1
  12. casaconfig-0.0.70/casaconfig/private/get_config.py +0 -20
  13. {casaconfig-0.0.70 → casaconfig-0.0.71}/LICENSE +0 -0
  14. {casaconfig-0.0.70 → casaconfig-0.0.71}/MANIFEST.in +0 -0
  15. {casaconfig-0.0.70 → casaconfig-0.0.71}/README.md +0 -0
  16. {casaconfig-0.0.70 → casaconfig-0.0.71}/casaconfig/__init__.py +0 -0
  17. {casaconfig-0.0.70 → casaconfig-0.0.71}/casaconfig/private/__init__.py +0 -0
  18. {casaconfig-0.0.70 → casaconfig-0.0.71}/casaconfig/private/casasiteconfig.py +0 -0
  19. {casaconfig-0.0.70 → casaconfig-0.0.71}/casaconfig/private/config_defaults.py +0 -0
  20. {casaconfig-0.0.70 → casaconfig-0.0.71}/casaconfig/private/data_available.py +0 -0
  21. {casaconfig-0.0.70 → casaconfig-0.0.71}/casaconfig/private/do_pull_data.py +0 -0
  22. {casaconfig-0.0.70 → casaconfig-0.0.71}/casaconfig/private/get_argparser.py +0 -0
  23. {casaconfig-0.0.70 → casaconfig-0.0.71}/casaconfig/private/get_data_lock.py +0 -0
  24. {casaconfig-0.0.70 → casaconfig-0.0.71}/casaconfig/private/io_redirect.py +0 -0
  25. {casaconfig-0.0.70 → casaconfig-0.0.71}/casaconfig/private/measures_available.py +0 -0
  26. {casaconfig-0.0.70 → casaconfig-0.0.71}/casaconfig/private/print_log_messages.py +0 -0
  27. {casaconfig-0.0.70 → casaconfig-0.0.71}/casaconfig/private/set_casacore_path.py +0 -0
  28. {casaconfig-0.0.70 → casaconfig-0.0.71}/casaconfig/private/update_all.py +0 -0
  29. {casaconfig-0.0.70 → casaconfig-0.0.71}/casaconfig.egg-info/SOURCES.txt +0 -0
  30. {casaconfig-0.0.70 → casaconfig-0.0.71}/casaconfig.egg-info/dependency_links.txt +0 -0
  31. {casaconfig-0.0.70 → casaconfig-0.0.71}/casaconfig.egg-info/requires.txt +0 -0
  32. {casaconfig-0.0.70 → casaconfig-0.0.71}/casaconfig.egg-info/top_level.txt +0 -0
  33. {casaconfig-0.0.70 → casaconfig-0.0.71}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: casaconfig
3
- Version: 0.0.70
3
+ Version: 0.0.71
4
4
  Summary: CASA Operational Configuration Package
5
5
  Home-page: https://github.com/casangi/casaconfig
6
6
  Author: National Radio Astronomy Observatory
@@ -18,9 +18,9 @@ parser.add_argument( "--data-update", dest='dataupdate', action='store_const', c
18
18
  parser.add_argument( "--measures-update", dest='measuresupdate', action='store_const', const=True, default=False,
19
19
  help="invoke measures_update() to update measurespath to the latest measures data")
20
20
  parser.add_argument( "--update-all", dest='updateall', action='store_const', const=True, default=False,
21
- help="invokes data_update then measures_update to update measurespath to the latest casarundata and measures data")
21
+ help="invoke update_all() to populate (update) measurespath with the latest casarundata and measures data")
22
22
  parser.add_argument( "--reference-testing", action='store_const', const=True, dest='referencetesting', default=False,
23
- help="set measurespath to the casarundata when this version of casa was produced, used for testing purposes")
23
+ help="set measurespath to the casarundata when this version was produced, used for testing purposes")
24
24
  parser.add_argument( "--current-data", dest='currentdata', action='store_const', const=True, default=False,
25
25
  help="print out a summary of the current casarundata and measures data installed in measurespath and then exit")
26
26
 
@@ -104,9 +104,9 @@ for __v in __defaults:
104
104
  if (__v in __path_names) :
105
105
  # expand ~ or ~user constructs and make sure they are absolute paths
106
106
  if (type(globals()[__v]) is list) :
107
- vlist = list(map(__os.path.expanduser, globals()[__v]))
108
- vlist = list(map(__os.path.abspath,vlist))
109
- globals()[__v] = vlist
107
+ __vlist = list(map(__os.path.expanduser, globals()[__v]))
108
+ __vlist = list(map(__os.path.abspath,__vlist))
109
+ globals()[__v] = __vlist
110
110
  else:
111
111
  globals()[__v] = __os.path.abspath(__os.path.expanduser(globals()[__v]))
112
112
 
@@ -1,7 +1,7 @@
1
- # search path for measurement sets and images to load, when empty then [measurespath] is used
1
+ # lsit of paths where CASA should search for data subdirectories. Default [measurespath].
2
2
  datapath = [ ]
3
3
 
4
- # location of geodetic and ephemera data, default path for casaconfig data functions
4
+ # location of required measures data, takes precedence over any measures data also present in datapath.
5
5
  measurespath = "~/.casa/data"
6
6
 
7
7
  # automatically update measures data if not current (measurespath must be owned by the user)
@@ -26,7 +26,7 @@ nologfile = False
26
26
  # print log output to terminal when True (in addition to any logfile and CASA logger)
27
27
  log2term = False
28
28
 
29
- # do not start the CASA logger when True
29
+ # do not start the CASA logger GUI when True
30
30
  nologger = False
31
31
 
32
32
  # avoid starting GUI tools when True. If True then the CASA logger is not started even if nologger is False
@@ -15,7 +15,7 @@
15
15
  this module will be included in the api
16
16
  """
17
17
 
18
- def data_update(path=None, auto_update_rules=False, version=None, force=False, logger=None):
18
+ def data_update(path=None, version=None, force=False, logger=None, auto_update_rules):
19
19
  """
20
20
  Check for updates to the installed casarundata and install the update or change to
21
21
  the requested version when appropriate.
@@ -25,25 +25,26 @@ def data_update(path=None, auto_update_rules=False, version=None, force=False, l
25
25
  must already exist in path in order to use this function. Use pull_data to install
26
26
  casarundata into a new location.
27
27
 
28
- If path is None then config.measurespath will be used.
28
+ If path is None then config.measurespath is used.
29
29
 
30
30
  If the version is None (the default) then the most recent version returned by
31
31
  data_available is used.
32
32
 
33
- If the version requested matches the one in that text file then this function does
33
+ If the version requested matches the one in the readme.txt file at path then this function does
34
34
  nothing unless force is True.
35
35
 
36
- If a specific version is not requested (the default) and the date in that text file
37
- is today, then this function does nothing unless force is True even if there is a more
36
+ If a specific version is not requested (the default) and the date in the readme.txt file
37
+ at path is today, then this function does nothing unless force is True even if there is a more
38
38
  recent version available from the CASA server.
39
39
 
40
40
  When auto_update_rules is True then path must be owned by the user, force must be
41
- False and the version must be None. This is used by casatools initialization when
42
- data_auto_update is True.
41
+ False and the version must be None. This is used during casatools initialization when
42
+ data_auto_update is True. Automatic updating happens during casatools initialization
43
+ so that the updated casarundata and measures are in place before any tool needs to use them.
43
44
 
44
45
  If an update is to be installed the previously installed files, as listed in the
45
- readme.txt file, will first be removed and then all of the contents of the version
46
- being installed by the update are installed. This includes the set of measures tables
46
+ readme.txt file at path, are removed before the contents of the version
47
+ being installed are unpacked. This includes the set of measures tables
47
48
  that are part of that casarundata version. A data update is typically followed by a
48
49
  measures_update to ensure that the most recent measures data are installed.
49
50
 
@@ -72,14 +73,14 @@ def data_update(path=None, auto_update_rules=False, version=None, force=False, l
72
73
  write permissions there). The version must then also be None and the force option must be False.
73
74
 
74
75
  **Note:** the most recent casarundata may not include the most recent measures data. A data_update
75
- is typically followed by a measures update.
76
+ is typically followed by a measures_update.
76
77
 
77
78
  Parameters
78
79
  - path (str) - Folder path to update. Must contain a valid readme.txt. If not set then config.measurespath is used.
79
- - auto_update_rules (bool=False) - If True then the user must be the owner of path, version must be None, and force must be False.
80
80
  - version (str=None) - Version of casarundata to retrieve (usually in the form of casarundata-x.y.z.tar.gz, see data_available()). Default None retrieves the latest.
81
81
  - force (bool=False) - If True, always re-download the casarundata. Default False will not download casarundata if already updated today unless the version parameter is specified and different from what was last downloaded.
82
82
  - logger (casatools.logsink=None) - Instance of the casalogger to use for writing messages. Default None writes messages to the terminal.
83
+ - auto_update_rules (bool=False) - If True then the user must be the owner of path, version must be None, and force must be False.
83
84
 
84
85
  Returns
85
86
  None
@@ -0,0 +1,20 @@
1
+ def get_config( default=False ):
2
+ """
3
+ Get configuration values as a list of strings which can be logged, stored, or evaluated.
4
+
5
+ The default values (returned when default is True) are the configuration values after all config files have been evaluated but before the path values have been expanded using os.path.expanduser and os.path.abspath. Modules that use the command line to change config values may also not update the default values. User actions in a CASA session will also typically not change the default values.
6
+
7
+ Parameters
8
+ default (bool=False) - If True, return the default values.
9
+
10
+ Returns
11
+ list[str] - list of configuration strings
12
+ """
13
+
14
+ from .. import config as _config
15
+ if not default :
16
+ valsObj = _config
17
+ else:
18
+ valsObj = _config._config_defaults
19
+
20
+ return list( map( lambda name: f'{name} = {repr(getattr(valsObj,name))}', _config.__defaults ) )
@@ -33,8 +33,8 @@ def get_data_info(path=None, logger=None):
33
33
  into place when a modular CASA is built. It is the release.txt for the
34
34
  data appropriate for that module CASA release and it used by the "--reference-testing"
35
35
  command line option for casaconfig. That allows casaconfig to install that
36
- casarundata version for testing purposes. The release information comes from the
37
- casaconfig module and does not depend on the path argument.
36
+ casarundata version for testing purposes. The release information does not depend
37
+ on the path argument.
38
38
 
39
39
  If path is empty or does not exist then the return value for the 'casarundata' and
40
40
  'measures' types is None.
@@ -49,9 +49,9 @@ def get_data_info(path=None, logger=None):
49
49
  and ephemeris directories are present in path then the version returned for 'measures' is
50
50
  'unknown' and the date is an empty string. The path location may contain measures data from
51
51
  a legacy installation of CASA data. CASA may be able to use any measures tables at this
52
- location by they may not be maintained by casaconfig.
52
+ location by they can not be maintained by casaconfig.
53
53
 
54
- If 'release_data_readme.txt' file is not found with the casaconfig module the returned
54
+ If no casadata release information is found the returned
55
55
  value for 'release' is None and the "--reference-testing" option will not do anything
56
56
  for this installation of casaconfig. This will be the case for a modular installation.
57
57
 
@@ -63,7 +63,7 @@ def get_data_info(path=None, logger=None):
63
63
  - logger (casatools.logsink=None) - Instance of the casalogger to use for writing messages. Default None writes messages to the the terminal.
64
64
 
65
65
  Returns
66
- dict - a dictionary by type, 'casarundata', 'measures', 'release' where each type is a dictionary 'version', 'date'. A return value of None indicates path is unset. A value of None for that type means no information could be found about that type.
66
+ dict - a dictionary by type, 'casarundata', 'measures', 'release' where each type is a dictionary containing 'version' and 'date'. A return value of None indicates path is unset. A value of None for that type means no information could be found about that type.
67
67
  """
68
68
 
69
69
  # when None is returned, path wasn't set
@@ -15,7 +15,7 @@
15
15
  this module will be included in the api
16
16
  """
17
17
 
18
- def measures_update(path=None, auto_update_rules=False, version=None, force=False, logger=None):
18
+ def measures_update(path=None, version=None, force=False, logger=None, auto_update_rules=False):
19
19
  """
20
20
  Retrieve IERS data used for measures calculations from ASTRON server
21
21
 
@@ -27,7 +27,7 @@ def measures_update(path=None, auto_update_rules=False, version=None, force=Fals
27
27
  A text file (readme.txt in the geodetic directory in path) records the version string
28
28
  and the date when that version was installed in path.
29
29
 
30
- If path is None then config.measurespath will be used.
30
+ If path is None then config.measurespath is used.
31
31
 
32
32
  If the version requested matches the one in that text file then this function does
33
33
  nothing unless force is True.
@@ -36,18 +36,26 @@ def measures_update(path=None, auto_update_rules=False, version=None, force=Fals
36
36
  is today, then this function does nothing unless force is True even if there is a more
37
37
  recent version available from the ASTRON server.
38
38
 
39
- Automatic updating (when the measures_auto_update config value is True) uses this
40
- function as the casatools module is starting so that the updated measures are in
41
- place before any tool needs to use them.
39
+ When auto_update_rules is True then path must be owned by the user, force must be False,
40
+ and the version must be None. This is used during casatools initialization when
41
+ measures_auto_update is True. Automatic updating happens during casatools initialization
42
+ so that the updated measures are in place before any tool needs to use them.
42
43
 
43
44
  Using measures_update after casatools has started should always be followed by exiting
44
45
  and restarting casa (or the casatools module if modular casa components are being used).
45
46
 
46
- A file lock is used to prevent more that one measures_update and data_update from updating
47
- the measures files in path at the same time. When locked, the lock file (data_update.lock
48
- in path) will contain information about the process that has the lock. When a measures_update
49
- gets the lock it will check the readme.txt file in the geodetic directory in path
50
- to make sure that an update is still necessary (if force is True an update always happens).
47
+ A file lock is used to prevent more that one data update (pull_data, measures_update,
48
+ or data_update) from updating any files in path at the same time. When locked, the
49
+ lock file (data_update.lock in path) contains information about the process that
50
+ has the lock. When measures_update gets the lock it checks the readme.txt file in path
51
+ to make sure that an update is still necessary (if force is True then an update
52
+ always happens). If the lock file is not empty then a previous update of path (pull_data,
53
+ data_update, or measures_update) did not exit as expected and the contents of path are
54
+ suspect. In that case, an error will be reported and nothing will be updated. The lock
55
+ file can be checked to see the details of when that file was locked. The lock file can be
56
+ removed and measures_update can be tried again. It may be safest in that case to remove path
57
+ completely or use a different path and use pull_data to install a fresh copy of the
58
+ desired version.
51
59
 
52
60
  Care should be used when using measures_update outside of the normal automatic
53
61
  update that other casa sessions are not using the same measures at the same time,
@@ -72,10 +80,10 @@ def measures_update(path=None, auto_update_rules=False, version=None, force=Fals
72
80
 
73
81
  Parameters
74
82
  - path (str) - Folder path to place updated measures data. Must contain a valid geodetic/readme.txt. If not set then config.measurespath is used.
75
- - auto_update_rules (bool=False) - If True then the user must be the owner of path, version must be None, and force must be False.
76
83
  - version (str=None) - Version of measures data to retrieve (usually in the form of yyyymmdd-160001.ztar, see measures_available()). Default None retrieves the latest.
77
84
  - force (bool=False) - If True, always re-download the measures data. Default False will not download measures data if already updated today unless the version parameter is specified and different from what was last downloaded.
78
85
  - logger (casatools.logsink=None) - Instance of the casalogger to use for writing messages. Default None writes messages to the terminal
86
+ - auto_update_rules (bool=False) - If True then the user must be the owner of path, version must be None, and force must be False.
79
87
 
80
88
  Returns
81
89
  None
@@ -17,9 +17,9 @@ this module will be included in the api
17
17
 
18
18
  def pull_data(path=None, version=None, force=False, logger=None):
19
19
  """
20
- Pull the package data contents from the CASA host and install it in path.
20
+ Pull the casarundata contents from the CASA host and install it in path.
21
21
 
22
- The path must either contain a previously installed version of the package data
22
+ The path must either contain a previously installed version of casarundata
23
23
  or it must not exist or be empty.
24
24
 
25
25
  If path is None then config.measurespath will be used.
@@ -36,7 +36,7 @@ def pull_data(path=None, version=None, force=False, logger=None):
36
36
  version already matches what was previously installed (no installation is then
37
37
  necessary unless force is True).
38
38
 
39
- The measures tables included in the package data will typically
39
+ The measures tables included in casarundata will typically
40
40
  not be the most recent version. To get the most recent measures data, measures_update
41
41
  should be used after pull_data.
42
42
 
@@ -53,12 +53,12 @@ def pull_data(path=None, version=None, force=False, logger=None):
53
53
  did not exit as expected and the contents of path are suspect. In that case, pull_data
54
54
  will report that as an error and nothing will be updated. The lock file can be checked
55
55
  to see the details of when that file was locked. The lock file can be removed and
56
- pull_data can be then be used to install the desired version. It may be safest in that case
56
+ pull_data can then be used to install the desired version. It may be safest in that case
57
57
  to remove path completely or use a different path and run pull_data to install
58
58
  a fresh copy of the desired version.
59
59
 
60
60
  Some of the tables installed by pull_data are only read when casatools starts. Use of
61
- pull_data after CASA has started should typically be followed by a restart so that
61
+ pull_data should typically be followed of CASA by a restart so that
62
62
  any changes are seen by the tools and tasks that use this data.
63
63
 
64
64
  Parameters
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: casaconfig
3
- Version: 0.0.70
3
+ Version: 0.0.71
4
4
  Summary: CASA Operational Configuration Package
5
5
  Home-page: https://github.com/casangi/casaconfig
6
6
  Author: National Radio Astronomy Observatory
@@ -6,7 +6,7 @@ with open('README.md', "r") as fid: #encoding='utf-8'
6
6
 
7
7
  setup(
8
8
  name='casaconfig',
9
- version='0.0.70',
9
+ version='0.0.71',
10
10
  description='CASA Operational Configuration Package',
11
11
  long_description=long_description,
12
12
  long_description_content_type="text/markdown",
@@ -1,20 +0,0 @@
1
- def get_config( default=False ):
2
- """
3
- Get configuration values as strings which can be logged, stored or evaluated.
4
-
5
- The default values (returned with default is True) are the config values after all config files have been evaluated but before the path values have been expanded using os.path.expanduser and os.path.abspath. Modules that use the command line to change config values may also not update the default values. User actions in a CASA session will also typically not change the default values.
6
-
7
- Parameters
8
- default (bool=False) - If True, return the default values.
9
-
10
- Returns
11
- list[str] - list of configuration strings
12
- """
13
-
14
- from .. import config as _config
15
- if not default :
16
- valsObj = _config
17
- else:
18
- valsObj = _config._config_defaults
19
-
20
- return list( map( lambda name: f'{name} = {repr(getattr(valsObj,name))}', _config.__defaults ) )
File without changes
File without changes
File without changes
File without changes