-
Notifications
You must be signed in to change notification settings - Fork 120
Fixed issues with call to Super class #2781
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
base: stable
Are you sure you want to change the base?
Conversation
|
@ReimarBauer and @matrss , Here basically I have done changes such as initialized object states with certain conditions (like In case of unlimited dimensions of |
matrss
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both classes seem to have at least parts of their constructors copied over from the classes they inherit, so just calling the super classes constructor is not enough, it has to be checked what that constructor does and what ours do so far, what the differences are, and how to achieve the same result with a cleaner refactoring of these classes.
mslib/utils/netCDF4tools.py
Outdated
|
|
||
| def __init__(self, files, exclude=None, skip_dim_check=None, | ||
| require_dim_num=False): | ||
| super().__init__(files) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All method code belongs below its docstring.
mslib/utils/netCDF4tools.py
Outdated
| if_unlimited_dim = any(dim.isunlimited() for dim in cdfm.dimensions.values()) | ||
| if not if_unlimited_dim: | ||
| super().__init__() | ||
| self._cdf = [cdfm] | ||
| self._isopen = True | ||
| else: | ||
| super().__init__(files) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Together with the super().__init__ call at the top this will always result in calling the super classes constructor twice. That can't be right.
@matrss thanks for the detailed review I'll make the mentioned changes and additions with a fresh commit in the PR very soon and also refractor the parent class constructor with updated calling |
|
@matrss pls review this PR and the changes ,
Also, what should I do the fix other issues occurring here |
|
@matrss and @ReimarBauer pls review this PR , i have done some changes |
|
@matrss can i know why is this error occurring ? i think it's not related to the issue |
|
Well, it doesn't happen without your changeset, so it must be related somehow. |
May I know what changes must be done to fix the same , as I'm unable to get this error |
|
I was able to reproduce the error by following what the failing workflow does: https://github.com/Open-MSS/MSS/actions/runs/14640654490/workflow?pr=2781. On the stable branch this error doesn't happen. |

Purpose of PR?:
Fixes #2750
fix: add missing super().init() calls
This PR adds the missing
super().__init__()calls inMFDatasetCommonDimsandWebMapServiceto ensure proper parent class initialization.Ensured proper initialization of the parent class
netCDF4.MFDataset, improving compatibilityand following rules of OOPs (object-oriented principles).