Skip to content

Commit 3d6ee46

Browse files
committed
Merged PR 2555: Release 0.0.3
**Breaking change** - Removed the Projector.get_transformer() method and changed the method signature to Projector.transform(from_srid, to_srid, from_east, from_north). - Update CHANGES.md. - Bump version number to 0.0.3. Related work items: #5558, #5559
2 parents 1fe49bb + 0bc57eb commit 3d6ee46

21 files changed

Lines changed: 791 additions & 722 deletions

.gitignore

Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
build/
12+
develop-eggs/
13+
dist/
14+
downloads/
15+
eggs/
16+
.eggs/
17+
lib/
18+
lib64/
19+
parts/
20+
sdist/
21+
var/
22+
wheels/
23+
share/python-wheels/
24+
*.egg-info/
25+
.installed.cfg
26+
*.egg
27+
MANIFEST
28+
29+
# PyInstaller
30+
# Usually these files are written by a python script from a template
31+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
32+
*.manifest
33+
*.spec
34+
35+
# Installer logs
36+
pip-log.txt
37+
pip-delete-this-directory.txt
38+
39+
# Unit test / coverage reports
40+
htmlcov/
41+
.tox/
42+
.nox/
43+
.coverage
44+
.coverage.*
45+
.cache
46+
nosetests.xml
47+
coverage.xml
48+
*.cover
49+
*.py,cover
50+
.hypothesis/
51+
.pytest_cache/
52+
cover/
53+
test-output.xml
54+
55+
# Translations
56+
*.mo
57+
*.pot
58+
59+
# Django stuff:
60+
*.log
61+
local_settings.py
62+
db.sqlite3
63+
db.sqlite3-journal
64+
65+
# Flask stuff:
66+
instance/
67+
.webassets-cache
68+
69+
# Scrapy stuff:
70+
.scrapy
71+
72+
# Sphinx documentation
73+
docs/_build/
74+
75+
# PyBuilder
76+
.pybuilder/
77+
target/
78+
79+
# Jupyter Notebook
80+
.ipynb_checkpoints
81+
82+
# IPython
83+
profile_default/
84+
ipython_config.py
85+
86+
# pyenv
87+
# For a library or package, you might want to ignore these files since the code is
88+
# intended to run in multiple environments; otherwise, check them in:
89+
# .python-version
90+
91+
# pipenv
92+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
93+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
94+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
95+
# install all needed dependencies.
96+
#Pipfile.lock
97+
98+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
99+
__pypackages__/
100+
101+
# Celery stuff
102+
celerybeat-schedule
103+
celerybeat.pid
104+
105+
# SageMath parsed files
106+
*.sage.py
107+
108+
# Environments
109+
.env
110+
.venv
111+
env/
112+
venv/
113+
ENV/
114+
env.bak/
115+
venv.bak/
116+
117+
# Spyder project settings
118+
.spyderproject
119+
.spyproject
120+
121+
# Rope project settings
122+
.ropeproject
123+
124+
# mkdocs documentation
125+
/site
126+
127+
# mypy
128+
.mypy_cache/
129+
.dmypy.json
130+
dmypy.json
131+
132+
# Pyre type checker
133+
.pyre/
134+
135+
# pytype static type analyzer
136+
.pytype/
137+
138+
# Cython debug symbols
139+
cython_debug/
140+
141+
#Ides
142+
.idea/

.vscode/launch.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"name": "Python: Current File",
9+
"type": "python",
10+
"request": "launch",
11+
"program": "${file}",
12+
"console": "integratedTerminal",
13+
"justMyCode": true
14+
}
15+
]
16+
}

CHANGES.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# NGI Python Projector Package
22

3+
_2022-03-08_
4+
5+
Version 0.0.3
6+
7+
- Breaking change: Removed the Projector.get_transformer() method and changed the
8+
method signature to Projector.transform(from_srid, to_srid, from_east, from_north).
9+
- Add two new methods ensure_tz() and datetime_to_json().
10+
311
_2022-03-02_
412

513
Version 0.0.1

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@ to_srid = "3857"
3333
# Paris Lat(48.8589506) Lon(2.2768485) EPSG:4326
3434
from_east, from_north = 2.2768485, 48.8589506
3535

36-
transformer = projector.get_transformer(f"{from_srid}-{to_srid}")
37-
projected_east, projected_north = projector.transform(transformer, from_east, from_north)
36+
projected_east, projected_north = projector.transform(from_srid, to_srid, from_east, from_north)
3837

3938
# Paris Lat(6250962.06) Lon(253457.62) EPSG:3857 is in metres - 2D projection
4039
assert abs(projected_east - 253457.62) <= 0.01

azure-pipelines.yml

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,27 @@ trigger:
77
- develop
88
- main
99

10+
resources:
11+
repositories:
12+
- repository: ngi-shared-artifacts
13+
type: git
14+
name: ngi-shared-artifacts
15+
1016
pool:
1117
vmImage: ubuntu-latest
1218

1319
steps:
20+
- checkout: self
21+
- checkout: ngi-shared-artifacts
22+
23+
- task: CopyFiles@2
24+
displayName: copy projections.json from ngi-shared-artifacts
25+
inputs:
26+
Contents: "$(Build.SourcesDirectory)/ngi-shared-artifacts/gis/projections.json"
27+
TargetFolder: "$(Build.SourcesDirectory)/ngi-projector/src/ngi_projector/"
28+
OverWrite: true
29+
flattenFolders: true
30+
1431
- task: UsePythonVersion@0
1532
inputs:
1633
versionSpec: "3.9"
@@ -22,26 +39,32 @@ steps:
2239
pip install twine
2340
poetry install
2441
displayName: "Install dependencies"
42+
workingDirectory: "$(Build.SourcesDirectory)/ngi-projector"
2543
2644
- script: |
2745
poetry run bandit -r src
2846
displayName: "bandit"
47+
workingDirectory: "$(Build.SourcesDirectory)/ngi-projector"
2948
3049
- script: |
31-
poetry run mypy src
50+
poetry run mypy src tests
3251
displayName: "mypy"
52+
workingDirectory: "$(Build.SourcesDirectory)/ngi-projector"
3353
3454
- script: |
3555
poetry run pytest . --cov tests --cov src --cov-report html
3656
displayName: "pytest"
57+
workingDirectory: "$(Build.SourcesDirectory)/ngi-projector"
3758
3859
- script: poetry version $(poetry version -s)-dev.$(Build.BuildId)
3960
displayName: "Add pre-release version"
4061
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/develop'))
62+
workingDirectory: "$(Build.SourcesDirectory)/ngi-projector"
4163

4264
- script: |
4365
poetry build
4466
displayName: "Build package"
67+
workingDirectory: "$(Build.SourcesDirectory)/ngi-projector"
4568
4669
- task: TwineAuthenticate@1
4770
inputs:
@@ -50,3 +73,4 @@ steps:
5073
- script: |
5174
twine upload -r fieldmanager --config-file $(PYPIRC_PATH) dist/*.whl
5275
displayName: Upload package to Azure Artifact
76+
workingDirectory: "$(Build.SourcesDirectory)/ngi-projector"

mypy.ini

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[mypy]
2+
3+
[mypy-timezonefinder.*]
4+
# The timezonefinder package has a merged PR that will enable typing, so next release
5+
# of timezonefinder (version > 5.2.0) should allow for mypy type checking
6+
ignore_missing_imports = True

0 commit comments

Comments
 (0)