Changeset 5442
- Timestamp:
- Dec 20, 2022 3:17:16 PM (3 months ago)
- Files:
-
- 1 added
- 1 deleted
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIctrlGUI.py
r5394 r5442 5458 5458 '''Check if the GSAS-II repository has an update for the current source files 5459 5459 and perform that update if requested. 5460 ''' 5460 ''' 5461 5461 if not GSASIIpath.whichsvn(): 5462 5462 dlg = wx.MessageDialog(self.frame, … … 5494 5494 dlg.Destroy() 5495 5495 return 5496 errmsg,warnmsg = G2gd.TestOldVersions() 5497 if (errmsg or warnmsg): 5498 msg = 'Based on the age of Python or an installed Python package (see below)' 5499 msg += ' you are recommended to' 5500 if GSASIIpath.condaTest(): 5501 msg += ' either use conda to update (see https://bit.ly/G2pkgs for version recommendations) and then update GSAS-II. Or' 5502 msg += ' reinstall GSAS-II (see https://bit.ly/G2install), which will update both.\n\n' 5503 if errmsg: 5504 opt = wx.YES_NO|wx.ICON_QUESTION|wx.CANCEL|wx.NO_DEFAULT 5505 msg += 'Error(s):\n\t'+errmsg 5506 else: 5507 opt = wx.YES_NO|wx.ICON_QUESTION|wx.CANCEL|wx.YES_DEFAULT 5508 if warnmsg: 5509 if errmsg: msg += '\n\nWarning(s):\n\t' 5510 msg += warnmsg 5511 5512 msg += '\n\nContinue to update GSAS-II?' 5513 dlg = wx.MessageDialog(self.frame, msg,'Confirm update',opt) 5514 result = wx.ID_NO 5515 try: 5516 result = dlg.ShowModal() 5517 finally: 5518 dlg.Destroy() 5519 if result != wx.ID_YES: return 5496 5520 print ('GSAS-II version on server: '+repos) 5497 5521 if local == repos: … … 5536 5560 'conflicts arise, local changes will be ' 5537 5561 'discarded. It is also possible that the ' 5538 ' local changesmay prevent GSAS-II from running. '5562 'merge may prevent GSAS-II from running. ' 5539 5563 '\n\nPress OK to start an update if this is acceptable:', 5540 5564 'Local GSAS-II Mods', … … 5603 5627 'if merging is not possible, your local changes will be ' 5604 5628 'discarded. It is also possible that the ' 5605 ' local changes my prevent GSAS-II from running. '5629 'merge may prevent GSAS-II from running. ' 5606 5630 'Press OK to continue anyway.', 5607 5631 'Local GSAS-II Mods', -
trunk/GSASIIdataGUI.py
r5433 r5442 390 390 versions that are known to have bugs. One should select an older or 391 391 newer version of the package. 392 * ``versionDict['tooNewUntested']`` is a dict with module versions that have 393 not been tested but there is no reason to expect problems 392 394 * ``versionDict['tooNewWarn']`` is a dict with module versions that have not 393 been tested but raise concerns that problems may occur.395 been tested but there are concerns that problems may occur. 394 396 395 397 **Packages/versions to be avoided** … … 427 429 ''' 428 430 # add comments above when changing anything below 429 versionDict['tooOld'] = {'matplotlib': '1.' }431 versionDict['tooOld'] = {'matplotlib': '1.', 'Python':'2.7'} 430 432 'modules that will certainly fail' 431 versionDict['tooOldWarn'] = {'wx': '2.' }432 'modules that may fail butshould be updated'433 versionDict['tooOldWarn'] = {'wx': '2.','Python':'3.6'} 434 'modules that may fail and should be updated' 433 435 versionDict['badVersionWarn'] = {'numpy':['1.16.0'], 434 'matplotlib': ['3.1','3.2']} 436 'matplotlib': ['3.1','3.2'], 437 'wx':['4.2.0']} 435 438 'versions of modules that are known to have bugs' 436 versionDict['tooNewWarn'] = {'wx':'4.2' ,'python':'3.10'}439 versionDict['tooNewWarn'] = {'wx':'4.2'} 437 440 'module versions newer than what we have tested & where problems are suspected' 441 versionDict['tooNewUntested'] = {'Python':'3.11'} 442 'module versions newer than what we have tested & no problems are suspected' 438 443 439 444 def ShowVersions(): … … 446 451 import OpenGL as ogl 447 452 import GSASIIpath 448 # print (versions) 449 print ("Python module versions loaded:") 450 print (" Python: {} from {}".format(sys.version.split()[0],sys.executable)) 451 if compareVersions(platform.python_version(), 452 versionDict['tooNewWarn']['python']) >= 0: 453 print (22*' '+"-- We are anticipating significant problems with this new version of Python. Please report them.") 453 print ("Python/module versions loaded:") 454 454 version = '?' 455 455 versionDict['errors'] = '' 456 456 warn = False 457 for s,m in [(' wx',wx), ('matplotlib', mpl), ('numpy',np),457 for s,m in [('Python',None), ('wx',wx), ('matplotlib', mpl), ('numpy',np), 458 458 ('scipy',sp), ('OpenGL',ogl)]: 459 459 msg = '' 460 if s == 'Python': 461 pkgver = platform.python_version() 462 prefix = '' 463 msg = "from {}. ".format(sys.executable) 464 else: 465 pkgver = m.__version__ 466 prefix = 'Package ' 460 467 if s in versionDict['tooOld']: 461 match = compareVersions( m.__version__,versionDict['tooOld'][s])468 match = compareVersions(pkgver,versionDict['tooOld'][s]) 462 469 if match <= 0: 463 msg = "version will cause problems" 470 if msg: msg += ' -- ' 471 msg += "Too old, problems are likely" 464 472 warn = True 465 473 if versionDict['errors']: versionDict['errors'] += '\n' 466 versionDict['errors'] += 'Package {} version {} is too old for GSAS-II. An update is required'.format(s,m.__version__)474 versionDict['errors'] += prefix + '{} version {} is too old for GSAS-II. An update is required. '.format(s,pkgver) 467 475 if s in versionDict['tooOldWarn']: 468 match = compareVersions( m.__version__,versionDict['tooOldWarn'][s])476 match = compareVersions(pkgver,versionDict['tooOldWarn'][s]) 469 477 if match <= 0: 470 msg = "version can cause problems" 471 warn = True 472 if s in versionDict['tooNewWarn']: 473 match = compareVersions(m.__version__,versionDict['tooNewWarn'][s]) 474 if match >= 0: 475 msg = "version is too new and has not been tested" 478 msg += "Version can cause problems" 476 479 warn = True 477 480 if s in versionDict['badVersionWarn']: 478 481 for v in versionDict['badVersionWarn'][s]: 479 if compareVersions( m.__version__,v) == 0:480 msg = "version is known to be buggy"482 if compareVersions(pkgver,v) == 0: 483 msg += "Version is known to be buggy" 481 484 warn = True 482 485 break 483 print(" {:12s}{} {}".format(s+':',m.__version__,msg)) 486 if s in versionDict['tooNewWarn'] and not warn: 487 match = compareVersions(pkgver,versionDict['tooNewWarn'][s]) 488 if match >= 0: 489 msg += "Problems are anticipated with this version (not tested)" 490 warn = True 491 if s in versionDict['tooNewUntested'] and not warn: 492 match = compareVersions(pkgver,versionDict['tooNewUntested'][s]) 493 if match >= 0: 494 msg += "New version not tested; please keep us posted" 495 warn = True 496 print(" {:12s}{} {}".format(s+':',pkgver,msg)) 497 484 498 Image = None 485 499 try: … … 513 527 else: 514 528 rev = "SVN version {}".format(rev) 515 print ("Latest GSAS-II revision (from .py files): {} ({}) \n".format(529 print ("Latest GSAS-II revision (from .py files): {} ({})".format( 516 530 GSASIIpath.GetVersionNumber(),rev)) 517 531 # patch 11/2020: warn if GSASII path has not been updated past v4576. … … 525 539 print('Warning GSAS-II incompletely updated. Please contact toby@anl.gov') 526 540 # end patch 541 prog = 'convcell' 542 if sys.platform.startswith('win'): prog += '.exe' 543 if not os.path.exists(os.path.join(GSASIIpath.binaryPath,prog)): 544 versionDict['errors'] += 'Installed binary files need an update. If you built them, rerun scons' 545 warn = True 546 elif GSASIIpath.GetConfigValue('debug'): 547 print('N.B. current binaries have been updated') 527 548 if warn: 528 549 print('You are suggested to install a new version of GSAS-II.\nSee https://bit.ly/G2install', 529 550 '\n\nFor information on packages see\nhttps://gsas-ii.readthedocs.io/en/latest/packages.html and', 530 551 '\nhttps://gsas-ii.readthedocs.io/en/latest/GSASIIGUI.html#GSASIIdataGUI.versionDict') 531 552 print() 553 554 def TestOldVersions(): 555 '''Test the versions of required Python packages, etc. 556 Returns a non-empty text string if there are problems. 557 ''' 558 import numpy as np 559 import scipy as sp 560 import wx 561 import matplotlib as mpl 562 import OpenGL as ogl 563 warnmsg = '' 564 errmsg = '' 565 for s,m in [('Python',None), ('wx',wx), ('matplotlib', mpl), ('numpy',np), 566 ('scipy',sp), ('OpenGL',ogl)]: 567 if s == 'Python': 568 pkgver = platform.python_version() 569 prefix = '' 570 else: 571 pkgver = m.__version__ 572 prefix = 'Package '+s 573 if s in versionDict['tooOld']: 574 match = compareVersions(pkgver,versionDict['tooOld'][s]) 575 if match <= 0: 576 if errmsg: errmsg += '\n' 577 errmsg += prefix + '{} version {} is too old to run GSAS-II.'.format(s,pkgver) 578 if s in versionDict['tooOldWarn']: 579 match = compareVersions(pkgver,versionDict['tooOldWarn'][s]) 580 if match <= 0: 581 if warnmsg: warnmsg += '\n' 582 warnmsg += prefix + '{} version {} is likely too old for GSAS-II.'.format(s,pkgver) 583 if s in versionDict['badVersionWarn']: 584 for v in versionDict['badVersionWarn'][s]: 585 if compareVersions(pkgver,v) == 0: 586 if errmsg: errmsg += '\n' 587 errmsg += prefix + '{} version {} causes problems with GSAS-II.'.format(s,pkgver) 588 break 589 return errmsg,warnmsg 590 532 591 #### GUI creation ############################################################# 533 592 def GSASIImain(application): -
trunk/docs/source/packages.rst
r5438 r5442 45 45 * PyOpenGL (http://pyopengl.sourceforge.net/documentation). Note: a copy of this is distributed with GSAS-II (at present) and will be installed if the Python setuptools package is present. 46 46 47 Several packages are used in sections of the code, but are not47 Several Python packages are used in sections of the code, but are not 48 48 required. If these packages are not present, warning messages may be 49 49 generated if they would be needed, but the vast bulk of GSAS-II will function normally. … … 57 57 warning message appears on GSAS-II startup. 58 58 * imageio is used to make movies. 59 * svn: When using Anaconda we also encourage installation of the 60 svn (subversion) conda package. This is not actually part of Python 61 and can be installed directly into your system's configuration. It is used by 62 GSAS-II to download updates to our code. This can be skipped if svn 63 is installed directly (easy Linux, but a bit harder on MacOS and 64 Windows). In conda-forge this package is called subversion, but at 65 present is only available for Linux. 66 * pywin32 (windows only): this provides the win32com module that is 59 * requests: this package simplifies http access 60 (https://requests.readthedocs.io/). It is used for access to 61 webpages such as ISODISTORT and for some internal software downloads. 62 * win32com (windows only): this module is 67 63 used to install GSAS-II on windows machines. GSAS-II can be used on 68 64 Windows without this, but the installation will offer less 69 integration into Windows. 65 integration into Windows. Conda provides this under the name pywin32. 70 66 * conda: the conda package allows access to conda features from 71 inside Python. It will be used inc easingly by GSAS-II to67 inside Python. It will be used increasingly by GSAS-II to 72 68 self-install software. The conda package is installed by default in 73 69 miniconda and anaconda but if you create an environment for GSAS-II 74 70 (`conda create -n <env> package-list...`), it will not be added 75 71 unless you request it specifically. 76 * requests: this package simplifies http access 77 (https://requests.readthedocs.io/). It is used for access to 78 webpages such as ISODISTORT and for some internal software downloads. 72 73 The following are conda package is used in GSAS-II but is not 74 actually a Python package. 75 76 * svn (or subversion): the GSAS-II code works much better when 77 subversion is available to install and update the GSAS-II 78 code. Technically it is optional, but is not easy to bypass. The 79 Anaconda distribution once provided this, but does this no longer. With 80 the conda-forge repository we now use, it is only available for 81 Linux (where it really is not needed since it is easy to install 82 there) and the package is called subversion. For MacOS and Windows, the GSAS-II 83 self-installer now provides binaries for the svn program. 79 84 80 85 *Conda command*:
Note: See TracChangeset
for help on using the changeset viewer.