Skip to content

Domain print - #25

Merged
jonschwenk merged 2 commits into
mainfrom
domain_print
Feb 18, 2026
Merged

Domain print#25
jonschwenk merged 2 commits into
mainfrom
domain_print

Conversation

@jsta

@jsta jsta commented Feb 18, 2026

Copy link
Copy Markdown
Collaborator
# before
print(domain)
Domain(name='three_cells', mode='sites', provided=       gid                                           geometry
0  cell_01  POLYGON ((-151.75 69.25, -151.75 69.75, -152.2...
1  cell_02  POLYGON ((-151.25 69.25, -151.25 69.75, -151.7...
2  cell_03  POLYGON ((-150.75 69.25, -150.75 69.75, -151.2..., support=       gid                                           geometry
0  cell_01  POLYGON ((-151.75 69.25, -151.75 69.75, -152.2...
1  cell_02  POLYGON ((-151.25 69.25, -151.25 69.75, -151.7...
2  cell_03  POLYGON ((-150.75 69.25, -150.75 69.75, -151.2..., cells=       gid                                           geometry    lon   
lat
0  cell_01  POLYGON ((-151.75 69.25, -151.75 69.75, -152.2... -152.0  69.5
1  cell_02  POLYGON ((-151.25 69.25, -151.25 69.75, -151.7... -151.5  69.5
2  cell_03  POLYGON ((-150.75 69.25, -150.75 69.75, -151.2... -151.0  69.5, topounits=None, topounits_dim_name='topounit', topounits_id_col=
'topounit_id', topounits_gid_col='gid', met_support=None, topo_support=None, domain_nc=None, path_out=None, run_group=None)

# after
print(domain)
       gid                                           geometry    lon   lat
0  cell_01  POLYGON ((-151.75 69.25, -151.75 69.75, -152.2... -152.0  69.5
1  cell_02  POLYGON ((-151.25 69.25, -151.25 69.75, -151.7... -151.5  69.5
2  cell_03  POLYGON ((-150.75 69.25, -150.75 69.75, -151.2... -151.0  69.5

@jonschwenk
jonschwenk merged commit 5a8ebb9 into main Feb 18, 2026
2 checks passed
@jonschwenk
jonschwenk deleted the domain_print branch February 18, 2026 15:24
matthewhoffman added a commit that referenced this pull request Aug 27, 2026
Enable flexible filename patterns in export_met() by supporting {var}
placeholder in the filename parameter. This allows generating E3SM PR #25
compatible filenames (ERA5_{var}_1950-2025_z01.nc) directly without
post-processing file renaming.

Changes:
- Update _nc_filename() to detect {var} placeholder and use .format()
- Maintain backward compatibility with simple prefix format
- Update docstrings in Domain.export_met() and Exporter.run()

Example usage:
  domain.export_met(..., filename='ERA5_{var}_1950-2025_z01')
  # Generates: ERA5_TBOT_1950-2025_z01.nc, ERA5_FSDS_1950-2025_z01.nc, etc.

Legacy format still works:
  domain.export_met(..., filename='ERA5')
  # Generates: ERA5_TBOT.nc, ERA5_FSDS.nc, etc.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
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