Skip to content

Apply JMA Style naming#258

Open
yanorei32 wants to merge 1 commit intomasterfrom
fix/apply-jma-style-naming
Open

Apply JMA Style naming#258
yanorei32 wants to merge 1 commit intomasterfrom
fix/apply-jma-style-naming

Conversation

@yanorei32
Copy link
Copy Markdown
Member

@yanorei32 yanorei32 commented Apr 8, 2026

とりあえず最低限やってみた

Closes: #256

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 8, 2026

Rendering Results

demo_quake_prefecture_v0_base65536.png

demo_quake_prefecture_v0_base32768.png

demo_tsunami_forecast_v0_base32768.png

demo_tsunami_forecast_v1_base32768.png

@yanorei32 yanorei32 force-pushed the fix/apply-jma-style-naming branch from bdab5c8 to b42db34 Compare April 8, 2026 22:39
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 8, 2026

Rendering Results

demo_quake_prefecture_v0_base65536.png

demo_quake_prefecture_v0_base32768.png

demo_tsunami_forecast_v0_base32768.png

demo_tsunami_forecast_v1_base32768.png

@EEWBot EEWBot deleted a comment from github-actions bot Apr 8, 2026
Copy link
Copy Markdown
Member

@Siro256 Siro256 left a comment

Choose a reason for hiding this comment

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

やっぱり命名の方針をこのタイミングでメモしておきたい感があります。

  • 全部地震情報細分区域だと、コードなのかVec<コード>なのか分かりにくい(型を見れば分かるのはそうとして、書いていて体験が悪そう)ので、Vecならsを付けたい
  • 地震情報細分区域って長いので、細分区域、都道府県等、震度観測点、津波予報区のほうがいい気がしてきた

Comment thread asset-preprocessor/src/parse_shapefile.rs
Comment on lines +168 to +169
area_to_pref: &'a HashMap<codes::地震情報細分区域, codes::地震情報都道府県等>,
areas: HashSet<codes::地震情報細分区域>,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

area_to_pref -> 細分区域_to_都道府県等
areas -> 細分区域
とかに変えますか?(変えるなら同様の命名が関数の引数にもある)

Comment on lines +211 to +214
#[allow(non_snake_case)] area_code__pref_code: &HashMap<
codes::地震情報細分区域,
codes::地震情報都道府県等,
>,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

area_code__pref_code -> area_to_pref (細分区域_to_都道府県等)に変えてもよさそう

Comment on lines 12 to 14
struct TsunamiAreaCodeBuffer {
area_code_to_internal_code: HashMap<u32, u16>,
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

TsunamiAreaCodeBuffer -> 津波予報区CodeBuffer
area_code_to_internal_code -> 津波予報区_to_internal_code
とかどうですか?

@@ -72,7 +72,7 @@

struct AreaLines {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

AreaLines -> 津波予報区Lines

@@ -30,9 +30,9 @@ enum Lon {

#[derive(Debug)]
pub struct IntensityStationInternal {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

IntensityStationInternal -> 震度観測点Internal

HashMap<u32, usize>,
HashMap<codes::地震情報細分区域, codes::地震情報都道府県等>,
) {
let stations: Vec<JsonEntry> = serde_json::from_str(s).unwrap();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

stations -> 震度観測点

.collect();

#[allow(non_snake_case)]
let area_code__intensity_station_range: HashMap<_, _> = intensity_station_internal
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

地震情報細分区域_to_震度観測点_range

@@ -93,14 +93,14 @@ pub fn read(
#[allow(non_snake_case)]
let area_code__pref_code: HashMap<_, _> = intensity_station_internal
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

細分区域_to_都道府県等

.collect();

#[allow(non_snake_case)]
let station_code__index: HashMap<_, _> = intensity_station_internal
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

津波予報区_to_index

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

震度観測点かな

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

かも

@yanorei32
Copy link
Copy Markdown
Member Author

地震情報であるというコンテキストがコード上でついて回ってる限りはそれで良さそう…?

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