Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions data/v2/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -2156,6 +2156,20 @@ def csv_record_to_objects(info):

build_generic((PokemonDexNumber,), "pokemon_dex_numbers.csv", csv_record_to_objects)

def csv_record_to_objects(info):
dex_number = PokemonDexNumber.objects.get(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

should we use something like this to pre load a look up dict? PokemonDexNumber.objects.all() rather than multiple queries

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure since it is not done anywhere else in the file, and I don't know if it is pertinent since all we really need for an entry is the corresponding PokemonDexNumber

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

well currently it would execute one query everytime the fn is called its additional overhead once we add more games having a pre loaded dict on top level to fetch as a lookup cache would be much more efficient, i agree its not done elsewhere but thats because build.py is inefficient it does need a refactor :)

pokedex_id=int(info[0]),
pokedex_number=int(info[1]),
)

yield PokemonDexNumberVariety(
pokemon_dex_number_id=dex_number.id,
pokemon_id=int(info[2]),
order=int(info[3]),
)

build_generic((PokemonDexNumberVariety,), "pokemon_dex_number_varieties.csv", csv_record_to_objects)

def csv_record_to_objects(info):
yield PokemonEggGroup(pokemon_species_id=int(info[0]), egg_group_id=int(info[1]))

Expand Down
367 changes: 367 additions & 0 deletions data/v2/csv/pokemon_dex_number_varieties.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,367 @@
pokedex_id,pokedex_number,pokemon_id,order

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

i dont know why we have so many but will this be duplicated for all of these

Image

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

They are all of the Sun/Moon/Ultra Sun/Ultra Moon Pokédexes, since they were divided by islnd and USUM are different from SM in their entries.
We will have one file, but yes, the entries will need to be duplicated on all these Pokédexes, and each of the other ones existing in the API, from the national and Kanto dexes all the way to the Z-A and Champions dexes.

16,1,722,0
16,2,723,0
16,3,724,0
16,4,725,0
16,5,726,0
16,6,727,0
16,7,728,0
16,8,729,0
16,9,730,0
16,10,731,0
16,11,732,0
16,12,733,0
16,13,734,0
16,14,735,0
16,15,10091,0
16,15,19,1
16,16,10092,0
16,16,20,1
16,17,10,0
16,18,11,0
16,19,12,0
16,20,165,0
16,21,166,0
16,22,167,0
16,23,168,0
16,24,172,0
16,25,25,0
16,25,10094,1
16,25,10095,2
16,25,10096,3
16,25,10097,4
16,25,10098,5
16,25,10099,6
16,26,10100,0
16,26,26,1
16,27,736,0
16,28,737,0
16,29,738,0
16,30,438,0
16,31,185,0
16,32,440,0
16,33,113,0
16,34,242,0
16,35,446,0
16,36,143,0
16,37,79,0
16,38,80,0
16,38,10071,1
16,39,199,0
16,40,278,0
16,41,279,0
16,42,63,0
16,43,64,0
16,44,65,0
16,44,10037,1
16,45,10107,0
16,45,52,1
16,46,10108,0
16,46,53,1
16,47,81,0
16,48,82,0
16,49,462,0
16,50,10112,0
16,50,88,1
16,51,10113,0
16,51,89,1
16,52,58,0
16,53,59,0
16,54,96,0
16,55,97,0
16,56,296,0
16,57,297,0
16,58,235,0
16,59,739,0
16,60,740,0
16,61,92,0
16,62,93,0
16,63,94,0
16,63,10038,1
16,64,425,0
16,65,426,0
16,66,200,0
16,67,429,0
16,68,41,0
16,69,42,0
16,70,169,0
16,71,10105,0
16,71,50,1
16,72,10106,0
16,72,51,1
16,73,21,0
16,74,22,0
16,75,627,0
16,76,628,0
16,77,629,0
16,78,630,0
16,79,56,0
16,80,57,0
16,81,225,0
16,82,10123,0
16,82,10124,1
16,82,741,2
16,82,10125,3
16,83,742,0
16,84,743,0
16,85,548,0
16,86,549,0
16,87,546,0
16,88,547,0
16,89,54,0
16,90,55,0
16,91,129,0
16,92,130,0
16,92,10041,1
16,93,339,0
16,94,340,0
16,95,66,0
16,96,67,0
16,97,68,0
16,98,524,0
16,99,525,0
16,100,526,0
16,101,703,0
16,102,302,0
16,102,10066,1
16,103,744,0
16,104,745,0
16,104,10126,1
16,105,327,0
16,106,72,0
16,107,73,0
16,108,456,0
16,109,457,0
16,110,746,0
16,110,10127,1
16,111,370,0
16,112,222,0
16,113,747,0
16,114,748,0
16,115,90,0
16,116,91,0
16,117,371,0
16,118,372,0
16,119,373,0
16,119,10089,1
16,120,506,0
16,121,507,0
16,122,508,0
16,123,133,0
16,124,134,0
16,125,135,0
16,126,136,0
16,127,196,0
16,128,197,0
16,129,470,0
16,130,471,0
16,131,700,0
16,132,749,0
16,133,750,0
16,134,174,0
16,135,39,0
16,136,40,0
16,137,128,0
16,138,241,0
16,139,283,0
16,140,284,0
16,141,751,0
16,142,752,0
16,143,753,0
16,144,754,0
16,145,755,0
16,146,756,0
16,147,46,0
16,148,47,0
16,149,60,0
16,150,61,0
16,151,62,0
16,152,186,0
16,153,118,0
16,154,119,0
16,155,349,0
16,156,350,0
16,157,594,0
16,158,661,0
16,159,662,0
16,160,663,0
16,161,757,0
16,162,758,0
16,163,104,0
16,164,10115,0
16,164,105,1
16,165,115,0
16,165,10039,1
16,166,240,0
16,167,126,0
16,168,467,0
16,169,759,0
16,170,760,0
16,171,761,0
16,172,762,0
16,173,763,0
16,174,764,0
16,175,127,0
16,175,10040,1
16,176,765,0
16,177,766,0
16,178,704,0
16,179,705,0
16,180,706,0
16,181,351,0
16,181,10013,1
16,181,10014,2
16,181,10015,3
16,182,767,0
16,183,768,0
16,184,120,0
16,185,121,0
16,186,769,0
16,187,770,0
16,188,408,0
16,189,409,0
16,190,410,0
16,191,411,0
16,192,566,0
16,193,567,0
16,194,564,0
16,195,565,0
16,196,708,0
16,197,709,0
16,198,299,0
16,199,476,0
16,200,771,0
16,201,170,0
16,202,171,0
16,203,772,0
16,204,773,0
16,205,10118,0
16,205,10119,1
16,205,10120,2
16,206,568,0
16,207,569,0
16,208,227,0
16,209,132,0
16,210,173,0
16,211,35,0
16,212,36,0
16,213,774,0
16,213,10130,1
16,213,10131,2
16,213,10132,3
16,213,10133,4
16,213,10134,5
16,213,10135,6
16,213,10136,7
16,213,10137,8
16,213,10138,9
16,213,10139,10
16,213,10140,11
16,213,10141,12
16,213,10142,13
16,214,374,0
16,215,375,0
16,216,376,0
16,216,10076,1
16,217,137,0
16,218,233,0
16,219,474,0
16,220,674,0
16,221,675,0
16,222,775,0
16,223,324,0
16,224,776,0
16,225,777,0
16,226,239,0
16,227,125,0
16,228,466,0
16,229,10109,0
16,229,74,1
16,230,10110,0
16,230,75,1
16,231,10111,0
16,231,76,1
16,232,551,0
16,233,552,0
16,234,553,0
16,235,328,0
16,236,329,0
16,237,330,0
16,238,443,0
16,239,444,0
16,240,445,0
16,240,10058,1
16,241,707,0
16,242,778,0
16,243,779,0
16,244,780,0
16,245,359,0
16,245,10057,1
16,246,361,0
16,247,362,0
16,247,10074,1
16,248,478,0
16,249,215,0
16,250,461,0
16,251,10101,0
16,251,27,1
16,252,10102,0
16,252,28,1
16,253,10103,0
16,253,37,1
16,254,10104,0
16,254,38,1
16,255,582,0
16,256,583,0
16,257,584,0
16,258,209,0
16,259,210,0
16,260,422,0
16,261,423,0
16,262,369,0
16,263,781,0
16,264,318,0
16,265,319,0
16,265,10070,1
16,266,320,0
16,267,321,0
16,268,131,0
16,269,102,0
16,270,10114,0
16,270,103,1
16,271,782,0
16,272,783,0
16,273,784,0
16,274,587,0
16,275,123,0
16,276,212,0
16,276,10046,1
16,277,198,0
16,278,430,0
16,279,447,0
16,280,448,0
16,280,10059,1
16,281,147,0
16,282,148,0
16,283,149,0
16,284,142,0
16,284,10042,1
16,285,785,0
16,286,786,0
16,287,787,0
16,288,788,0
16,289,789,0
16,290,790,0
16,291,791,0
16,292,792,0
16,293,793,0
16,294,794,0
16,295,795,0
16,296,796,0
16,297,797,0
16,298,798,0
16,299,799,0
16,300,800,0
16,301,801,0
16,301,10147,1
16,302,802,0
Loading
Loading