Skip to content

Commit

Permalink
update GWMS transforms
Browse files Browse the repository at this point in the history
This update improves handling of factory-entries data product.
  • Loading branch information
vitodb authored and mambelli committed Sep 22, 2022
1 parent 0296667 commit 16e1751
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,12 @@ def transform(self, datablock):
# Get factory global classad dataframe
factory_globals = datablock.get("factoryglobal_manifests")
factory_entries = datablock.get("Factory_Entries")
entries = pandas.DataFrame(
pandas.concat([factory_entries.xs(et) for et in _SUPPORTED_ENTRY_TYPES], ignore_index=True, sort=True)
)
entries = pandas.DataFrame([])
all_factory_entries = [
factory_entries.xs(et) for et in _SUPPORTED_ENTRY_TYPES if et in factory_entries.index
]
if all_factory_entries:
entries = pandas.DataFrame(pandas.concat(all_factory_entries, ignore_index=True, sort=True))
if entries.empty:
self.logger.info("There are no entries to request resources from")
return dict.fromkeys(["glideclientglobal_manifests", "glideclient_manifests"], pandas.DataFrame())
Expand Down
4 changes: 3 additions & 1 deletion src/decisionengine_modules/glideinwms/transforms/grid_figure_of_merit.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ def transform(self, datablock):
"""

self.logger.debug("in GridFigureOfMerit transform")
entries = self.Factory_Entries(datablock).xs("Grid")
entries = pandas.DataFrame([])
if "Grid" in self.Factory_Entries(datablock).index:
entries = self.Factory_Entries(datablock).xs("Grid")
if entries is None:
entries = pandas.DataFrame({ATTR_ENTRYNAME: []})
foms = []
Expand Down

0 comments on commit 16e1751

Please sign in to comment.