-
Notifications
You must be signed in to change notification settings - Fork 6
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
(SE) Use swell_static_files_user
as an alternate location for all tasks
#360
Comments
I found references to
From what I can tell, in Do we want similar behavior for the other tasks as well? I.e., We effectively pull in every file from One key issue with this behavior is that there is no way to force swell to not copy over files from Note that an insidious version of this is if you have the same files but the naming and/or directory structure of the files changes between Personally, my vote would be to just define a task-specific swell_static_files = self.config.swell_static_files()
swell_static_files_user = self.config.swell_static_files_user(None)
if swell_static_files_user is not None:
swell_static_files = swell_static_files_user
# [...]
source_paths = [os.path.join(swell_static_files, ...)]
link_all_files...(self.logger, source_paths, target_path) Alternatively, maybe the point is that, if you want to provide a complete replacement, you just set the Let me know what you think. |
I thought about this and read your thoughts. I think users should choose only one of these options (user or global). As you mentioned, combining sources make it very confusing and hard to follow which files/configurations are being used. Also, in a way, users would get familiar with how to use SWELL and where files are coming from (given that we should provide documentation on that 😄). I personally learn the most when the code fails!
I think user still should have full control of their local static folder and make their changes there. That's how Ricardo and I have been operating. This is a separate concern but during the SWELL development meeting there was a brief discussion on version control with the |
Got it. In that case, I think the correct implementation is not to have a separate
Agreed that we should figure this out, and also that it should be a separate issue. I'll open that now. |
@Dooruk Sorry, one more question: Is there a use case where users would use If the latter, this becomes trivial because it already works --- we just drop If there are situations where, within a single swell run, you might want to use |
The more I think about it the more indecisive I get, but let me share my thoughts. Short answer, yes an option to pick which tasks one would like to use their own folder would be useful, but I just worry this complicates usage even further. R2D2 does some of what you are proposing elegantly with the fetch order, but does not specify tasks. In the case of In the case of There would be more tasks using this in the future. |
Understood, thanks! For now, I'll implement swell_static_files = Config.swell_static_files()
swell_static_files_user = Config.swell_static_files_user()
if swell_static_files_user:
swell_static_files = swell_static_files_user
do_stuff(swell_static_files) I'm not thrilled about this design for multiple reasons, but pending large scale overhaul of how we do configs (per #314), this is probably the easiest thing to do. |
* sles15 is now default platform, added to docs reflecting this and other additions (#407) * swell_static_files_user in config now used in appropriate tasks (#360) * addressed potential error on abort caused by undefined logger call * renamed datetime utility to avoid hinting confusion with base package, added type hinting (#349) * type hinting for all python methods (#349) * removed unnecessary pass of logger to functions copy_platform_files and copy_eva_files * type hinting in run_geos_executable uses Optional * Hinting changes, Logger properly type hinted, pd.DataFrame now used, typing.Optional used where appropriate * Update docs/configuring_cylc.md Co-authored-by: Alexey Shiklomanov <[email protected]> * added proper hinting for SilentUndefined instance in jinja2.py * proper syntax for linking docs * direct type hinting for FileHandler objects * added Optional typing where appropriate * added missing type hint in run_jedi_hofx_executable.py, fixed missing typing functions * more types in hint * more precise type hinting * Resolved code test error * more specific type hinting per mypy * corrected logger instance in type hint * Revised type hinting * Revised datetime typing, other refinements * Further revised type hinting * Update src/swell/utilities/render_jedi_interface_files.py Updated type hint to optional for consistency Co-authored-by: Alexey Shiklomanov <[email protected]> --------- Co-authored-by: Alexey Shiklomanov <[email protected]>
Currently,
swell_static_files_user
is only used ingenerate_b_climatology_by_linking
task. For others tasks and CI tests, the generic location for static files is/discover/nobackup/projects/gmao/advda/SwellStaticFiles
. However, we could give users ability to useswell_static_files_user
for their own static files as an alternative to the generic location.The text was updated successfully, but these errors were encountered: