-
Notifications
You must be signed in to change notification settings - Fork 20
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
New "original filenames" methods #448
Comments
Regarding my joint reviews for #449 and the upstream 1. Difference in original filename method keywords for data and for fieldsThe code block you provide here as an example doesn't work for the implementations, seemingly because the method on a Field has only defined a Is this correct, that we only allow 2. Possibility of specifying files not currently present (e.g. on the filesystem)I was also wondering if it is the intention that the user can specify files to
but just want to check! Even so, it might be worth including a warning via the logging system if a file is detected by |
(Sorry, should really have posted my comment above on the |
Hi @sadielbartholomew, Thanks for #448 (comment).
I'm thinking about this ...
Perhaps a loglevel == -1 warning? |
I was thinking more a 3/'DETAIL' log level as users won't be using debug (generally), is that too for exposed for your liking? |
Hi Sadie,
Been thinking about this a bit more, and am now not so keen on issuing such a warning when "update" or "define" is used. If a warning is not issued then this implies that you can be sure that the files will exist and be readable at a future time when you need them, which is not guaranteed. Original filenames will typically be set by |
Hi Sadie,
My original thinking was that updating/defining filenames on construct (as opposed to However - this situation also occurs for the So I'm now thinking like you and "update" and "define" should be available on all |
Hi David, thanks for the updates on your thinking regarding the questions raised. Regarding #448 (comment), that all makes sense to me now you justify it as such, particularly you pointing out:
and I am happy to stick with no warning and keep this aspect as-is! So I guess we are fine with the current implementation, but I think it is a good idea to note within the documentation that additions to Otherwise we can consider my question (2) in #448 (comment) resolved. (Will reply to your second comment separately after lunch.) |
That seems sensible. Thanks for clarifying.
OK, I follow and agree with your in-hindsight logic here. I agree with that justification and it would also be more consistent and therefore user-friendly for them to have matching signatures. So shall we go with that plan? |
The conversation at #365 discussed how to record the names of files that contained some or all of the data at instantiation time - typically (but not necessarily) from a read call.
I propose a new suite of
original_filenames
methods that allow us to define, report, and edit these "original" files - those that contained some or all of the data at instantiation time - and are independent of theget_filenames
methods.get_filenames
reports on any files that are used by Data objects at the time of asking, which might reported different (typically fewer) files than were being used at the time of data instantiation.It is also the case that the daskification of the cf-python library confuses functionality of the
get_filenames
methods - due to the new lazy execution paradigm, the notion of files in use at the time of asking is a little fuzzy. For this reason, theget_filenames
methods are likely to be deprecated. Edit: These have now been deprecated in the PRThe implementation of this will be in
cfdm
and entirely inherited into cf-python. See NCAS-CMS/cfdm#215 for the implementation details, which were initially proposed as (pending review):You might want to edit the original file names if you are creating constructs ab initio (without
cf.read
, which will set them for you automatically), or if you are creating a Field (or Data or any other construct) that is some combination of others - in this case you might want to store the superset of original files.Many thanks to @ThibHlln for first raising this the issue in #365.
The text was updated successfully, but these errors were encountered: