Skip to content

Separate FReDT from EDDIE#373

Draft
LukeParky wants to merge 14 commits intomasterfrom
eddie_separate_repos
Draft

Separate FReDT from EDDIE#373
LukeParky wants to merge 14 commits intomasterfrom
eddie_separate_repos

Conversation

@LukeParky
Copy link
Member

DESCRIPTION OF PR:

This PR is closely coupled with GeospatialResearch/eddie_floodresilience#2

It is a large piece of work, fully separating the core functionality of EDDIE (data aggregation and processing) from the flood-resilience module (FReDT). This culminates in them becoming two separate modules.

The majority of the code has been extracted, but documentation needs to be finalised and code review needs to take place to make sure some of the code around configuration and GeoServer is in the correct repos.

Developer Checklist

  • Make code change
  • Update tests
    • Update / create new tests
    • Ensure these tests have the expected behaviour
    • Test locally and ensure tests are passing
  • Update documentation
    • Readme
    • Docstrings
    • Comments
    • Wiki

Reviewer Checklist

  • Check new code for code smells
  • Check new tests
    • Ensure adequate coverage
    • Check for code smells within tests
  • Check if documentation needs updating
    • Readme
    • Docstrings
    • Comments
    • Wiki

@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
5 New issues
3 Security Hotspots
E Security Rating on New Code (required ≥ A)
E Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

Copy link
Member Author

@LukeParky LukeParky left a comment

Choose a reason for hiding this comment

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

Some easy comments, some investigation, and some that may require a separate issue

<string>EPSG:2193</string>
</responseSRS>
<srs>EPSG:2193</srs>
</coverage> No newline at end of file
Copy link
Member Author

Choose a reason for hiding this comment

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

Add newline

Copy link
Member Author

Choose a reason for hiding this comment

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

add issue to pull some of the EPSG:3857 optimisation changes from water-tracing-dashboard



def add_style(style_name: str, style_xml: bytes) -> None:
"""#todo"""
Copy link
Member Author

Choose a reason for hiding this comment

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

Complete this

Comment on lines +150 to +153
"""Create a GeoServer style for flood rasters using the viridis color scale."""
style_name = "viridis_raster"
with open('./src/eddie_floodresilience/flood_model/templates/viridis_raster.sld', 'rb') as payload:
add_style(style_name, payload)
Copy link
Member Author

Choose a reason for hiding this comment

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

This may be more appropriate to be in the FReDT repo, since it concerns water depth

Copy link
Member Author

Choose a reason for hiding this comment

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

Why did this move from raster_layers to geoserver_common? Investigate this.

Comment on lines +45 to 49
eddie_plugins = discover_plugins()
for name, module in eddie_plugins.items():
importlib.import_module(f"{name}.blueprint")
app.register_blueprint(module.blueprint.blueprint)

Copy link
Member Author

Choose a reason for hiding this comment

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

Confirm how well this works and its ease of setting up and potential conflicts with other packages that already exist on PyPi or conda-forge or elsewhere

for _finder, name, _is_pkg in pkgutil.iter_modules() if name.startswith('eddie_')
}
log.info(f"Plugins discovered: {plugins}")
return plugins No newline at end of file
Copy link
Member Author

Choose a reason for hiding this comment

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

Add newline

setup_logging()
log = logging.getLogger(__name__)

def discover_plugins() -> dict[str, ModuleType]:
Copy link
Member Author

Choose a reason for hiding this comment

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

Add docstring. Does this indicate a broken linting rule? Investigate

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant