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

Default CNSGA Offspring Filename Not Valid on Windows #246

Closed
electronsandstuff opened this issue Sep 16, 2024 · 1 comment
Closed

Default CNSGA Offspring Filename Not Valid on Windows #246

electronsandstuff opened this issue Sep 16, 2024 · 1 comment

Comments

@electronsandstuff
Copy link
Contributor

Hey folks. I was using data from the CNSGA generator recently and discovered that the default name for "offspring files" contains the colon character which is reserved on windows filesystems (https://learn.microsoft.com/en-us/windows/win32/fileio/naming-a-file).

Here is the section of code which writes the file.

    def write_offspring(self, filename=None):
        """
        Write the current offspring to a CSV file.

        Similar to write_population
        """
        if self._offspring is None:
            logger.warning("No offspring to write")
            return

        if filename is None:
            filename = f"{self.name}_offspring_{xopt.utils.isotime(include_microseconds=True)}.csv"
            filename = os.path.join(self.output_path, filename)

        self._offspring.to_csv(filename, index_label="xopt_index")

Here are some examples of files that are getting generated.

cnsga_offspring_2024-08-30T14:04:59.094665-05:00.csv
cnsga_offspring_2024-08-30T14:09:29.129272-05:00.csv
cnsga_offspring_2024-08-30T14:13:17.169997-05:00.csv
@roussel-ryan
Copy link
Collaborator

Addressed by #251

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants