Skip to content

PyHSPF fails when source directory is greater than 64 chars #10

@lucashtnguyen

Description

@lucashtnguyen

This issue is similar to #4 but a little nuanced. The package fails when it is installed from source if the source directory is longer than 64 chars. For example, I've installed from my source directory at '/mnt/c/Users/lnguyen/Documents/GitHub/pyHSPF/' but when you add the location of the message wdm file ('src/pyhspf/core/hspfmsg.wdm') we get pasted 64 chars pretty easily.

The message file directory is hard coded into WDMUtil class at line 106.

I propose that the messagepath be an optional kwarg, such as:

class WDMUtil:
    """Class to open and read from WDM files."""

    def __init__(self,
                 verbose = True,
                 messagepath = None,
                 ):
        """
        Initialize WDM environment.

        ...
        self.messagepath = messagepath

        ...
        if not self.messagepath:
            directory = os.path.dirname(hspf.__file__)
            self.messagepath = '{}/pyhspf/core/hspfmsg.wdm'.format(directory)
        """

Which would allow for a user defined location in e.g. './hspfmsg.wdm'
A PR is a click away if this API change is okay by you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions