Skip to content

Conversation

@arporter
Copy link
Member

No description provided.

@arporter arporter marked this pull request as draft January 12, 2026 11:25
@arporter arporter self-assigned this Jan 12, 2026
@codecov
Copy link

codecov bot commented Jan 12, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.95%. Comparing base (ee25f8a) to head (3d219c9).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3278      +/-   ##
==========================================
- Coverage   99.95%   99.95%   -0.01%     
==========================================
  Files         376      376              
  Lines       53485    53462      -23     
==========================================
- Hits        53463    53440      -23     
  Misses         22       22              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@arporter
Copy link
Member Author

This is ready for a first look now from @hiker, @sergisiso or @LonelyCat124. I've fired off the IT in the meantime.

Copy link
Collaborator

@sergisiso sergisiso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for cleaning this up @arporter , there are a couple extra methods and the mention to the default API that maybe can also be removed.

"PSyclone enabled keep_comments."
in caplog.record_tuples[0][2])
output, _ = capsys.readouterr()
success = False
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is nothing wrong with this code but note that in other places we have been using the pattern:

with caplog.at_level(logging.WARNING):
    assert "text" in caplog.text

which I think it's slightly clearer.

assert ("' doesn't end with a recognised "
"file extension. Assuming free form." in
caplog.record_tuples[0][2])
success = False
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

Config._HAS_CONFIG_BEEN_INITIALISED = True

def api_conf(self, api=None):
def api_conf(self, api: str = None):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

= "" if the type is just str?

Getter for the object holding API-specific configuration options.
:param str api: Optional, the API for which configuration details are
:param api: Optional, the API for which configuration details are
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we still have the concept of default API? I see you modified the rtype/raises saying it errors if there the api is not valid.

Grepping "default API" has 4 hits, should we edit those?

Comment on lines +419 to +420
:rtype: Union[:py:class:`psyclone.configuration.LFRicConfig`,
:py:class:`psyclone.configuration.GOceanConfig`]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move type to the signature?

# Now create the reverse lookup (for better error messages):
self._reverse_access_mapping = {v: k for k, v in
self._access_mapping.items()}
logger.warn(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I get a "The function warn is deprecated: Deprecated since Python 3.3. Use Logger.warning() instead."

# dictionary. The input is in the format: key1:value1,
# key2=value2, ...
'''
def __init__(self, section: SectionProxy):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Linebreak above

gh_write) to the AccessType (e.g. AccessType.WRITE).
:returns: The access mapping to be used by this API.
:rtype: Dictionary of strings
def get_access_mapping(self) -> dict[str]:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we still need this? Shouldn't the code get it directly form constants?

This is used to provide the user with API specific error messages.
:returns: The mapping of access types to API-specific strings.
:rtype: Dictionary of strings
def get_reverse_access_mapping(self) -> dict[str]:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same for this one

api_config = Config.get().api_conf()
rev_access_mapping = api_config.get_reverse_access_mapping()
return rev_access_mapping.get(self, str(self).lower())
rmap = Config.get().api_conf().get_reverse_access_mapping()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

get_constants().REVERSE_ACCESS_MAPPING ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants