-
-
Notifications
You must be signed in to change notification settings - Fork 481
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
gh-36746: pep8 in various interfaces
pep8 clean in several files in `interfaces` ### 📝 Checklist - [x] The title is concise, informative, and self-explanatory. - [x] The description explains in detail what this PR is about. URL: #36746 Reported by: Frédéric Chapoton Reviewer(s): Matthias Köppe
- Loading branch information
Showing
8 changed files
with
52 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
tarball=configure-VERSION.tar.gz | ||
sha1=cba1a107f45084e1884ca8a873504c70eec9c16c | ||
md5=b61e77023581c8994c73313e867a6c26 | ||
cksum=615928275 | ||
sha1=8690edbf631421d19b51fa0383185e5b77e64cdc | ||
md5=2e5ce85812f7884700bdacdd5f6ff76e | ||
cksum=3867469893 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
9b1e18ffc022a8ed0e7451ccf190a009ceb2d81c | ||
4ae6301b8a3eef9d003f2275a186ebe64c44b257 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,14 +10,14 @@ | |
- Jonathan Gutow (2012-03-21): initial version | ||
""" | ||
|
||
#******************************************************************************* | ||
# ****************************************************************************** | ||
# Copyright (C) 2012 Jonathan Gutow ([email protected]) | ||
# | ||
# Distributed under the terms of the GNU General Public License (GPL) | ||
# as published by the Free Software Foundation; either version 2 of | ||
# the License, or (at your option) any later version. | ||
# http://www.gnu.org/licenses/ | ||
#******************************************************************************* | ||
# https://www.gnu.org/licenses/ | ||
# ****************************************************************************** | ||
|
||
from sage.structure.sage_object import SageObject | ||
|
||
|
@@ -72,12 +72,12 @@ def is_jvm_available(self): | |
return java_version_number >= 7 | ||
|
||
def export_image(self, | ||
targetfile, | ||
datafile, #name (path) of data file Jmol can read or script file telling it what to read or load | ||
datafile_cmd='script', #"script" or "load" | ||
image_type='PNG', #PNG, JPG, GIF | ||
figsize=5, | ||
**kwds): | ||
targetfile, | ||
datafile, # name (path) of data file Jmol can read or script file telling it what to read or load | ||
datafile_cmd='script', # "script" or "load" | ||
image_type='PNG', # PNG, JPG, GIF | ||
figsize=5, | ||
**kwds): | ||
r""" | ||
This executes JmolData.jar to make an image file. | ||
|
@@ -170,7 +170,7 @@ def export_image(self, | |
launchscript = launchscript + datafile | ||
|
||
imagescript = 'write {} {!r}\n'.format(image_type, target_native) | ||
size_arg = "%sx%s" % (figsize*100,figsize*100) | ||
size_arg = "%sx%s" % (figsize * 100, figsize * 100) | ||
# Scratch file for Jmol errors | ||
scratchout = tmp_filename(ext=".txt") | ||
with open(scratchout, 'w') as jout: | ||
|
@@ -179,9 +179,9 @@ def export_image(self, | |
env['LC_ALL'] = 'C' | ||
env['LANG'] = 'C' | ||
subprocess.call(["java", "-Xmx512m", "-Djava.awt.headless=true", | ||
"-jar", jmolpath, "-iox", "-g", size_arg, | ||
"-J", launchscript, "-j", imagescript], | ||
stdout=jout, stderr=jout, env=env) | ||
"-jar", jmolpath, "-iox", "-g", size_arg, | ||
"-J", launchscript, "-j", imagescript], | ||
stdout=jout, stderr=jout, env=env) | ||
if not os.path.isfile(targetfile): | ||
raise RuntimeError(f"Jmol failed to create file {targetfile}: {Path(scratchout).read_text()}") | ||
os.unlink(scratchout) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
r""" | ||
Interface to LattE integrale programs | ||
""" | ||
#***************************************************************************** | ||
# **************************************************************************** | ||
# Copyright (C) 2017 Vincent Delecroix <[email protected]> | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 2 of the License, or | ||
# (at your option) any later version. | ||
# http://www.gnu.org/licenses/ | ||
#***************************************************************************** | ||
# https://www.gnu.org/licenses/ | ||
# **************************************************************************** | ||
|
||
|
||
from sage.cpython.string import str_to_bytes, bytes_to_str | ||
|
@@ -134,15 +134,15 @@ def count(arg, ehrhart_polynomial=False, multivariate_generating_function=False, | |
if 'redundancy_check' not in kwds: | ||
args.append('--redundancy-check=none') | ||
|
||
for key,value in kwds.items(): | ||
for key, value in kwds.items(): | ||
if value is None or value is False: | ||
continue | ||
|
||
key = key.replace('_','-') | ||
key = key.replace('_', '-') | ||
if value is True: | ||
args.append('--{}'.format(key)) | ||
args.append(f'--{key}') | ||
else: | ||
args.append('--{}={}'.format(key, value)) | ||
args.append(f'--{key}={value}') | ||
|
||
if multivariate_generating_function: | ||
from sage.misc.temporary_file import tmp_filename | ||
|
@@ -200,12 +200,12 @@ def count(arg, ehrhart_polynomial=False, multivariate_generating_function=False, | |
else: | ||
raise NotImplementedError("there is no Sage object to handle multivariate series from LattE, use raw_output=True") | ||
else: | ||
if ans: # Sometimes (when LattE's preproc does the work), no output appears on stdout. | ||
if ans: # Sometimes (when LattE's preproc does the work), no output appears on stdout. | ||
ans = ans.splitlines()[-1] | ||
if not ans: | ||
# opening a file is slow (30e-6s), so we read the file | ||
# numOfLatticePoints only in case of a IndexError above | ||
with open(tempd.name+'/numOfLatticePoints', 'r') as f: | ||
with open(tempd.name + '/numOfLatticePoints', 'r') as f: | ||
ans = f.read() | ||
|
||
if raw_output: | ||
|
@@ -363,11 +363,11 @@ def integrate(arg, polynomial=None, algorithm='triangulate', raw_output=False, v | |
if value is None or value is False: | ||
continue | ||
|
||
key = key.replace('_','-') | ||
key = key.replace('_', '-') | ||
if value is True: | ||
args.append('--{}'.format(key)) | ||
args.append(f'--{key}') | ||
else: | ||
args.append('--{}={}'.format(key, value)) | ||
args.append(f'--{key}={value}') | ||
|
||
if got_polynomial: | ||
if not isinstance(polynomial, str): | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters