Skip to content

Conversation

@ReallyNiceGuy
Copy link

Behavior change on command line tool:

New command line switches:

-l -> Path for local tables
-p -> Provider of local table

The user can select a separate path and provider for local tables.

Behavior change on library:
A new parameter was added to Encode and Decode classes:
tables_local_dir: Path to search for local tables. Default is the same value as tables_root_dir. Here the path should already contain the provider of the table.

Suggest directory structure:

pybufrkit/tables
└── 0
    ├── 0_0
    └── 98_0

some_other_path/tables
└── 0
    ├── imd   <-- new local table with a provider name for selection
    │   └── 255_255
    └── meteofrance   <-- another new local table
    │   └── 42_0
    └── internal  <-- another new local table, with clashing table numbers with provider imd
        └── 255_255

Copy link
Owner

@ywangd ywangd left a comment

Choose a reason for hiding this comment

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

Mostly looking good. I have some minor comments that I'd appreciate if they can be addressed. Thanks!


ap.add_argument('-l', '--tables-local-directory',
help='The directory to locate local BUFR tables',
default=None)
Copy link
Owner

Choose a reason for hiding this comment

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

Nit: default=None is redundant


ap.add_argument('-p', '--tables-local-provider',
help='The provider for local BUFR tables',
default=None)
Copy link
Owner

Choose a reason for hiding this comment

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

Same here


ns.tables_local_directory = ns.tables_local_directory or ns.tables_root_directory
if ns.tables_local_provider:
ns.tables_local_directory = ns.tables_local_directory + "/" + ns.tables_local_provider
Copy link
Owner

Choose a reason for hiding this comment

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

Let's use os.path.join(...) since it handles different path separator on different platforms.


self.section_configurer = SectionConfigurer(definitions_dir=definitions_dir)
self.tables_root_dir = tables_root_dir or DEFAULT_TABLES_DIR
self.tables_local_dir = tables_local_dir or tables_root_dir
Copy link
Owner

Choose a reason for hiding this comment

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

I think this should be

Suggested change
self.tables_local_dir = tables_local_dir or tables_root_dir
self.tables_local_dir = tables_local_dir or self.tables_root_dir

Otherwise it could still be None.

@ReallyNiceGuy
Copy link
Author

ReallyNiceGuy commented Mar 22, 2025 via email

@ReallyNiceGuy ReallyNiceGuy force-pushed the disjoint_local_tables branch from 47bcd9d to d269d89 Compare March 22, 2025 10:40
@ReallyNiceGuy ReallyNiceGuy force-pushed the disjoint_local_tables branch from d269d89 to c0dd176 Compare March 22, 2025 10:46
@ReallyNiceGuy
Copy link
Author

I made the changes and force-pushed it to my branch.
Let me know if you want more changes.

Copy link
Owner

@ywangd ywangd left a comment

Choose a reason for hiding this comment

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

Thanks. Looks good to me. I'll be merging this.

@ywangd ywangd merged commit 5128e2e into ywangd:master Mar 22, 2025
5 checks passed
@ReallyNiceGuy ReallyNiceGuy deleted the disjoint_local_tables branch May 22, 2025 08:28
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