Changeset c012a1


Ignore:
Timestamp:
Sep 13, 2025, 3:00:43 PM (6 weeks ago)
Author:
Frederik Heber <frederik.heber@…>
Branches:
Candidate_v1.7.0, stable
Children:
15678e
Parents:
26cfa51
Message:

FIX: Boxmaker.py converted to python3.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • utils/Python/boxmaker.py.in

    r26cfa51 rc012a1  
    4545            exec('self.%s = "%s"' % (name, value))
    4646        else:
    47             print 'Warning: Unknown option:', name
     47            print('Warning: Unknown option:', name)
    4848
    4949
     
    5353        opt.basename = sys.argv[1]
    5454    else:
    55         print 'Usage: boxmaker.py <basename> [options]'
     55        print('Usage: boxmaker.py <basename> [options]')
    5656        exit()
    5757
     
    6464                    opt.update(L.strip(), R.strip())
    6565    except IOError:
    66         print 'Warning: Configuration file not readable, CLI only'
     66        print('Warning: Configuration file not readable, CLI only')
    6767
    6868    # Parse parameters
     
    168168            value = boolmap[value]
    169169        else:
    170             print 'Not a boolean value:', value
     170            print('Not a boolean value:', value)
    171171            exit()
    172172           
     
    214214    if opt.automass:
    215215        opt.molarmass = GetSourceMolareMass(opt, units)
    216         print '======== MOLAR MASS:', opt.molarmass
     216        print('======== MOLAR MASS:', opt.molarmass)
    217217
    218218
     
    222222
    223223    if newnumber != opt.number:
    224         print 'Warning: Number changed to %d.' % newnumber
     224        print('Warning: Number changed to %d.' % newnumber)
    225225
    226226    return [newroot] * 3
     
    254254    # Even distribution of current biggest prime to each vector -> similar sizes
    255255    if len(factors) < 3:
    256         print 'Warning: Not enough prime factors - falling back to cubic placement'
     256        print('Warning: Not enough prime factors - falling back to cubic placement')
    257257        return FindBestCube(opt)
    258258
     
    269269    result = [0]*3
    270270
    271     print '======== CUBOID USED:',
     271    print('======== CUBOID USED:')
    272272
    273273    for i in range(3):
    274274        result[i] = int( reduce(operator.mul, distri[i]) )
    275275
    276     print result
     276    print(result)
    277277    return result
    278278
     
    324324    try:
    325325        bb = GetSourceBBabs(opt)
    326         print '======== BBOX:', bb
     326        print('======== BBOX:', bb)
    327327        # Scaling factor - the molecules bounding box is scaled to fit the volume suiting the density
    328328        s = (VolumePerMolecule / (bb[0]*bb[1]*bb[2])) ** (1./3)
    329329
    330330        if s < 1:
    331             print 'Warning: Molecular cells will overlap.'
     331            print('Warning: Molecular cells will overlap.')
    332332
    333333        for i in range(3):
    334334            cell[i] = bb[i]*s
    335335    except ZeroDivisionError:
    336         print 'Warning:  Singularity in bounding box, falling back to cubic cell.'
    337        
    338 
    339 print '======== CELL: ', cell
     336        print('Warning:  Singularity in bounding box, falling back to cubic cell.')
     337       
     338
     339print('======== CELL: ', cell)
    340340
    341341mol.CommandVerbose('0')
     
    351351    domain[i] = cell[i]*nbox[i]
    352352
    353 print  '======== DOMAIN: ', domain
     353print('======== DOMAIN: ', domain)
    354354
    355355# Postprocessing
Note: See TracChangeset for help on using the changeset viewer.