Skip to content

Changes for the completed city-scale manuscript. #66

Merged
sammorrell merged 65 commits intomainfrom
develop
Nov 8, 2025
Merged

Changes for the completed city-scale manuscript. #66
sammorrell merged 65 commits intomainfrom
develop

Conversation

@sammorrell
Copy link
Copy Markdown
Member

@sammorrell sammorrell commented Nov 8, 2025

This merge includes the necessary changes in the develop branch to bring main up-to-date with the software version used in the city-scale modelling manuscript. The major changes include:

  • Reworking of configuration system to make it more flexible, including making config files more modular.
  • Added attribute chains, such that surfaces can be tagged with multiple, chained pipelines of attributes.
  • Added flexible, configurable boundary conditions to simulation domain boundary.
  • Removed explicit dependence upon 3D output grid at all points in simulation --- output grids can now be arbitrarily placed, including overlapping.

A detailed co-pilot generated summary of the changes are as follows:

This pull request introduces several new features and refactors to improve modularity and extensibility, particularly around mesh file handling and domain boundary configuration. The most significant updates are the addition of support for NetCDF-UGRID mesh files, new builder types for domain boundaries and histograms, and refactoring of mesh loading functions to enhance clarity and testability. There are also dependency and naming updates in Cargo.toml and various minor code cleanups.

New features

  • Added support for loading NetCDF-UGRID mesh files via the new mesh_from_ugrid function in src/fs/extensions/ugrid.rs, including tests for mesh loading. [1] [2] [3]
  • Introduced BoundaryBuilder and BoundaryConditionBuilder structs in src/geom/domain/boundary_builder.rs to enable flexible domain boundary configuration, including serialization and display logic. [1] [2] [3]
  • Added HistogramBuilder struct in src/data/histogram_builder.rs for constructing histograms, with serialization and display support. [1] [2]

Mesh file handling refactor

  • Refactored OBJ mesh loading: replaced the File trait implementation for Mesh with a standalone mesh_from_obj function in src/fs/extensions/wavefront.rs, and added unit tests for mesh loading. [1] [2] [3]
  • Updated NetCDF mesh loading to use ord::cartesian::{X, Y, Z} for axis naming consistency.

Dependency and configuration updates

  • Updated Cargo.toml: changed crate name to lowercase, added optional dependencies for MPI and Python (pyo3), and improved feature configuration for conditional compilation. [1] [2] [3] [4]

Code consistency and minor cleanups

  • Standardized crate naming to lowercase (aetherus) in documentation and examples. [1] [2]
  • Updated axis naming imports to use ord::cartesian throughout the codebase for consistency. [1] [2] [3] [4] [5]
  • Minor test and formatting cleanups in several modules. [1] [2] [3]

Logging and diagnostics

  • Added a diagnostic print statement to the LID file loader for improved debugging.

EdHone and others added 30 commits August 10, 2023 15:16
Re-implementing the mesh input to enable multiple file types
- Made `aetherus` snake-case, and updated necessary binaries, comments and test-cases.
- Removed ambigious *-imports, updated `use` statements where needed.
- Made all `test` modules private, avoids ambiguities in *-imports.
- Altered SphericalCDF to not pre-set / mut variables where not required.
MPI functionality for the Photon struct
- Updated `aetherus` crate name.
- Removed unused imports.
- Added feature attribs to imports required for the `mpi` feature.
- Added structs for Boundary, BoundaryCondition, BoundaryDirection.
- Added handling of grid boundary hitting event.
- Added hard-coded default behaviour to all engines.
- Improvement of boundary condition structs to work with MCRT.
- Fixed bug where boundary hit finding would not be tolerant of rounding.
- Integration of boundary condition into engines and MCRT main.
- Added supporting ray-plane intersect function to support changes.
- Removed dependence of engine and travel upon output grid that stretches across whole domain. Making way for more flexible output in the future.
- Added attribute chain variant of attribute.
- Added processing of AttributeChain in surface.
- Started implementation of linking for AttributeChain.
- Started refactor of output with new `io` module.
- Added volume output + tests.
- Added plane output + tests.
It makes more sense for the `PhotonCollector` struct to be contained in
the output module, so I have moved it there. I have changed references in
the code to point to this new location.
This struct is intended as the new central object containing all of the
output code for `mcrt`. It contains all of the other outputs. I am in the
process of refactoring all of the output structs to work with this.

- Added `Output` struct.
- Added builder structs which support deserialisation from JSON to allow init from config.
- Added supporting structs around output types to deserialise / integrate.
- Output struct in `io` module now implemented.
- Added Builder structure to deserialise and build Output.
- Added supporting deserialisation, config and builder structs for output types.
- Added voxel distance calculation to output volume to support next steps.
- Added `OutputRegistry` to support output linking.
This now means that the output parameters can be read in as part of the
main JSON5 input for the MCRT software. I had added a redirect here, so
it can be included either in the same file, or separate. Also added
output section to display.
sammorrell and others added 28 commits August 15, 2024 23:25
The removal of the `grid` parameter also removed access to a consistent
measurement grid over which to index into the shifts map in the fluorescence engine. However, I have engineered an alternate solution which indexes using
the bounds of the simulation and takes from the res of the grid, potentially
making this solution more flexible.
Boundary conditions + Outpur refactor
- Added output of LID loading to show path.
- Fixed incorrect output of `OutputVolumBuilder` boundary.
- Fixed warning in report macro with extraneous semicolon.
This commit contains my first attempt at adding the `AttributeChain` into
the linking chain. This means that we should now be able to link into the
MCRT.

I have also cleaned up after my first exploration.
dded the AttributeChain variant to the Attribute enums, as well as implementing it into the linker chain. This means that we can now chain together multiple attributes onto a single surface tag.

I've also added a unit test to check the deserialisation of JSON into the AttributeChain variant too
This module includes the transmissions, including photopic and scotopic vision functions, required to model vision. This includes generating plane outputs for lux.

This commit includes:
- Added `synphot` submodule in `phys`.
- Added `vision` module in `synphot`.
- Added `Transmission` and accompanying builder to allow us to model the transmission of vision systems.
- Added `lumeff` module, including `LuminousEfficacyFunction` to provide commonly used photopic and scotopic luminosity functions.
- Added supporting files for CIE (1924), Judd (1951) and Judd-Vos (1978) photopic functions, as well as the CIe (1951) scoptopic function.
- Added additional derives to `Probability` and `ProbabilityBuilder` to support new structs.
Includes the struct, a rough display implementation and inclusion in the `output` module.
- Added an initial implementation of an extra layer to the linker chain to support linking output planes.
- Integrated `Rasterise` variant into the `Attribute` enum.
- Modified `OutputPlaneBuilder` to accept the plane from deserialisation.
- Added `surface` implementation for `Rasterise`.
- Added None-match for the peel-off implementation.

TODO:
- Implement the `Display` properly for the `Attribute::Rasterise` variant.
- Modify unit tests to support new output plane JSON structure.
- Added `Rasterise` variants to link chain.
- Added `Display` match for `Rasterise` variants.
- Moved end of linker chain in parameters.
- Added new link step to MCRT code.
- Corrected top of linker chain to use `RasteriseBuilder` rather than `ProbabilityBuilder` for `Rasterise` variant.
- Added `Display` impl for `RasteriseBuilder` and `TransmissionBuilder`.
I have added a wrapper layer in the linker chain to elegantly allow us to both have a single point where the attribute chain starts, and to resolve an array of attribute declarations invisibly into an `AttributeChain` variant.
- Added `Hyperspectral` Attribute, including adding into deserialisation, linker chain and surface implementation.
- Added `hyperspectral` output parameter.
Merging changes that allow output of lux planes into `develop`. 

Summary of changes:
- Added rasterisation structures and Atttribute variants to oversee photon packet rasterisation into output. 
- Added synphot module, including commonly used photopic and scotopic vision luminous efficiency functions.
- Integrated new systems into existing MCRT binary.
Added hyperspectral output.

Summary of changes:
- Necessary addition to `Attribute` and linking chain to add `Hyperspectral` variant. 
- On the last point, I have added a layer to the linker chain to allow linking to volume outputs. 
- Implementation into surface hit. 
- Addition of output volume parameter variant. 
- Integration into MCRT binary.
- Added variant to `Rasterise` enum.
- Added variant to `RasteriseBuilder` enum, to allow deserialisation and building from JSON5.
- Removed unneeded `CorrelatedColourTemperature` variant to enum, as this is now implemented via hyperspectral output + post-processing.
Added photon packet counter to `Rasterise` attrib.
The `Rasteriser::Illuminance` variant now correctly divides the output pixels by the area. As we have mainly been using square 1m x 1m pixels, this has not been an issue, but I want to resolve this before it becomes an issue.
Corrected the units of the hyperspectral output to rasterise to W / m^2 / nm so that we have a spectral flux density for each pixel.

Also includes a basic test to check that the calculated projected pixel area, and in turn the spectral bin size, are correct.
This will allow us to break the configuration arrays down into small chunks and include them as normal in the parameters input.
Because the console crate has apparently been updated and no longer exports things required by `indicatif`, I am pinning to that version for now so that the build is allowed to complete.
Try to get the necessary features for `indicatif` to be imported by using the `std` feature in `console`.
Removed console dependency from Cargo.toml. This did not turn out to fix the compiling problem on GitHub actions.
@sammorrell
Copy link
Copy Markdown
Member Author

I had to make a small change to the dependencies (indicatif = "0.16.*" -> indicatif = "0.17.*"), and added a single line of code to handle the Result<> that was introduced for the new progress bar. Otherwise the code is the same as that used for the paper. Will now merge into main and replease.

@sammorrell sammorrell merged commit 0e43ccf into main Nov 8, 2025
1 of 2 checks passed
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.

2 participants