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

itask.py has code related to COMPSPlatform #2139

Open
ZDu-IDM opened this issue Sep 6, 2023 · 1 comment
Open

itask.py has code related to COMPSPlatform #2139

ZDu-IDM opened this issue Sep 6, 2023 · 1 comment
Assignees
Labels
bug Something isn't working COMPS Core

Comments

@ZDu-IDM
Copy link
Collaborator

ZDu-IDM commented Sep 6, 2023

File: idmtools_core/idmtools/entities/itask.py

def to_dict(self) -> Dict:
    """
    Select metadata fields and make a new dict.

    Returns: dict
    """
    from idmtools.core.context import get_current_platform

    result = dict()
    metadata_fields = self.metadata_fields
    platform = get_current_platform()
    for f in fields(self):
        if not f.name.startswith("_") and f.name not in ['parent']:
            try:
                from idmtools_platform_comps.comps_platform import COMPSPlatform
                if isinstance(platform, COMPSPlatform):
                    if f.name in metadata_fields:
                        result[f.name] = getattr(self, f.name)
                    else:
                        result[f.name] = f.default
                else:
                    result[f.name] = getattr(self, f.name)
            except ImportError:
                result[f.name] = getattr(self, f.name)
    return result

Note: we should remove COMPSPlatform dependency!

@ZDu-IDM ZDu-IDM added bug Something isn't working Core labels Sep 6, 2023
@issuelabeler issuelabeler bot added the COMPS label Sep 6, 2023
@devclinton
Copy link
Member

  • Investigate why this is here? What happens without this code? How does comps behave? How does slurm behave?
  • If there is a reason for this, can it be done in the platform?

@ZDu-IDM ZDu-IDM self-assigned this Dec 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working COMPS Core
Projects
None yet
Development

No branches or pull requests

2 participants