Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue followed PEP-8 standard #1083

Merged
merged 2 commits into from
Jul 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions regolith/builders/beamplanbuilder.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
"""Builder for the plan of beamtimes. The plan contains a summary of the information for the experiments in during a
beamtime and details about how to carry out the experiments."""
"""Builder for the planning of beamtimes.

The plan contains a summary of the information for the experiments
in during a beamtime and details about how to carry out the experiments.

"""

from datetime import datetime

Expand All @@ -11,10 +15,12 @@

class BeamPlanBuilder(LatexBuilderBase):
"""
Build a file of experiment plans for the beamtime from database entries. The report is in .tex file. The template
of the file is in the 'templates/beamplan.tex'. The data will be grouped according to beamtime. Each beamtime
will generate a file of the plans. If 'beamtime' in 'rc' are not None, only plans for those beamtime will be
generated.
Build a file of experiment plans for the beamtime from database entries.

The report is in the .tex file. The template of the file is in the
'templates/beamplan.tex'. The data will be grouped
according to beamtime. Each beamtime will generate a file of the plans.
If 'beamtime' in 'rc' are not None, only plans for those beamtime will be generated.

Methods
-------
Expand Down
5 changes: 3 additions & 2 deletions regolith/builders/coabuilder.py
Original file line number Diff line number Diff line change
Expand Up @@ -490,10 +490,11 @@
except TypeError:
print(f"ERROR: incorrect dates for an education/employment in {collab.get('name')}")
print(
f"collab date: {collab.get('interaction_date')}, advisee date: {advis.get('interaction_date')}"
f"collab date: {collab.get('interaction_date')}, "
f"advisee date: {advis.get('interaction_date')}"
)
raise
if col_bool == True:
if col_bool:

Check warning on line 497 in regolith/builders/coabuilder.py

View check run for this annotation

Codecov / codecov/patch

regolith/builders/coabuilder.py#L497

Added line #L497 was not covered by tests
collabs.append(collab)
collabs.extend(advisees)
collabs.extend(advisors)
Expand Down
3 changes: 1 addition & 2 deletions regolith/builders/cpbuilder.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ def construct_global_ctx(self):

def latex(self):
"""Render latex template"""
gtx = self.gtx
rc = self.rc
for group in self.gtx["groups"]:
self.gtx["grants"] = list(sorted(all_docs_from_collection(rc.client, "grants"), key=_id_key))
Expand Down Expand Up @@ -111,7 +110,7 @@ def latex(self):
# badids_pending = ([i["_id"] for i in pending_grants if
# not i.get('cpp_info',{}).get('cppflag', "")])
if badids:
print(f"these grants have a problem with ccp_info: {*badids,}")
print(f"these grants have a problem with ccp_info: {*badids, }")

iter = copy(current_grants)
for grant in iter:
Expand Down
1 change: 0 additions & 1 deletion regolith/builders/figurebuilder.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ def construct_global_ctx(self):

def latex(self):
"""Render latex template"""
rc = self.rc
for f in [ff for ff in os.listdir(".") if ff.endswith(".tex")]:
fn, ext = os.path.splitext(f)
self.render(f, fn + "_rend" + ext)
Expand Down
7 changes: 2 additions & 5 deletions regolith/builders/formalletterbuilder.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,17 @@

from datetime import datetime
import string
import os
from dateutil import parser as date_parser

try:
from bibtexparser.bwriter import BibTexWriter
from bibtexparser.bibdatabase import BibDatabase

HAVE_BIBTEX_PARSER = True
except ImportError:
HAVE_BIBTEX_PARSER = False

from regolith.tools import all_docs_from_collection, filter_publications, make_bibtex_file
from regolith.sorters import ene_date_key, position_key
from regolith.tools import all_docs_from_collection
from regolith.sorters import position_key
from regolith.builders.basebuilder import LatexBuilderBase

LATEX_OPTS = ["-halt-on-error", "-file-line-error"]
Expand Down Expand Up @@ -60,7 +58,6 @@ def construct_global_ctx(self):
gtx["zip"] = zip

def latex(self):
fd = gr = False
filestub, qualifiers = "", ""
if self.rc.from_date:
from_date = date_parser.parse(self.rc.from_date).date()
Expand Down
Loading