How best to handle the default (Earth) radius constant
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Facilidade para iniciantes
- 48/100
Direção de pesquisa
Comece por cf/constants.py e mixin/fielddomain.py; depois, inspecione o valor padrão do raio em cf.relative_vorticity e a convenção existente de Field.cell_area. Rastreie outras referências ao raio que usem o valor do raio da Terra e compare sua nomenclatura e seus valores padrão. Está concluído quando o valor padrão estiver centralizado e as referências afetadas oferecerem suporte consistente ao comportamento descrito para o raio da Terra.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
Throughout the codebase we often perform calculations using a value for the radius of a sphere. This can usually be assumed to be the Earth's because the relevant calculations concern the Earth's surface - but there may also be applications to extra-planetary atmospheres and oceans etc. so when referencing/naming the radius generally we should keep that wider scope in mind so as to not to possibly put off those wanting to do calculations for other planets.
During code review for #910 we decided to have a think about how best to handle the Earth radius default as a value that has a default to sensible precision (we use 6371229.0 meters generally), including as hard-coded at present as:
- in
mixin/fielddomain.pyas a float constant (potnetially not ideal as a float as technically that can vary very slightly by floating point precision, as a separate concern); - a
radiuskwarg value default forcf.relative_vorticity.
See thread in https://github.com/NCAS-CMS/cf-python/pull/910#discussion_r2967106221 for original discussion points.
Suggestion
I suggest that:
-
we add
earth_radius[_value]to theconstantsmodule as an integer value6371229and import there where necessary. The canonical units for it are already defined there:so it is nice to have it close to those as an additional benefit;
-
we change any
radiusreference to make sure it doesn't reference the 'Earth' in the name explicitly, but take our default Earth radius as default (the average user will be considering the Earth and surely in most cases not need to tweak the value from default precision); -
for any functions that use the default Earth radius, consult that constant - notably where there's a corresponding keyword argument
radiustake 'earth' as a string default to mean 'use the default earth value', as we presently do for many methods such asField.cell_area.
- Linguagem predominante
- Python
- Estrelas
- 151
- Forks
- 23
- Merge médio
- 1d 2h
- PRs com merge (30d)
- 1
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Sem modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de NCAS-CMS/cf-python
-
installation
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 45/100
-
Attempt at unsupported conservative 3D mesh regriddingTalvez livre de novo @sadielbartholomew assumiu há 40 dias e não há nenhum pull request aberto. Abertabug?
-
bug
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 45/100
-
API review (4.0.0) documentation
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 48/100
-
Testing of to/from xarrayAbertaenhancement xarray
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 48/100
Todas as issues de NCAS-CMS/cf-python
Issues semelhantes
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
-
[Device Support Request] HOBEIAN ZG-204ZL (Tuya PIR motion sensor with illuminance)Talvez já em andamento @lenucksi assumiu hoje. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
zigpy/zha-device-handlers#5493 ·
Mantenedores costumam responder em até 3 dias
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
drevendev/BeautifulRepo#42 ·
Mantenedores costumam responder em até 1 dia
-
enhancement good first issue
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 84/100
writerslogic/holographic-memory#93 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 66/100
antoine-tena/kiln#47 ·
Mantenedores costumam responder em até 1 dia