We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
These save functions have a lot in common. If you like consider creating an issue and attach this possible refactoring.
def _generate_save_path_and_name(self, name=None, path=None, extension=".pdf"): name = re.sub("\.", "_", name) if name else DT.date.today().strftime("%Y%m%d_%I%M%p") savepath = ( path if path else os.path.join(os.path.dirname(os.path.realpath("__file__")), "plot/") ) if not os.path.exists(savepath): os.makedirs(savepath) full_name = (os.path.join(savepath, name)) + extension return full_name def save(self, name=None, path=None, verbose=True): full_name = self._generate_save_path_and_name(name, path, ".pdf") self.fig.savefig(full_name, bbox_inches="tight", format="pdf", dpi=180) if verbose: print("save at: " + full_name) def save_pup(self, name=None, path=None, verbose=True): full_name = self._generate_save_path_and_name(name, path, ".pdf") self.fig.savefig(full_name, bbox_inches="tight", format="pdf", dpi=300) if verbose: print("save at: ", full_name) def save_light(self, name=None, path=None, verbose=True): full_name = self._generate_save_path_and_name(name, path, ".png") self.fig.savefig(full_name, bbox_inches="tight", format="png", dpi=180) if verbose: print("save with: ", name) _Originally posted by @cpaniaguam in https://github.com/brown-ccv/icesat2waves/pull/131#discussion_r1516893298_
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The text was updated successfully, but these errors were encountered: