From 5966afdbb3dfda655cd9574414b970e12250cb47 Mon Sep 17 00:00:00 2001 From: Mvin8 Date: Mon, 21 Jul 2025 12:03:38 +0300 Subject: [PATCH] feat: New documentation --- README.rst | 309 +++++++++++------- docs/requirements.txt | 2 +- docs/source/about_us.rst | 29 +- .../popframe.method.aglomeration.rst | 29 ++ .../popframe.method.anchor_settlement.rst | 29 ++ .../popframe.method.base_method.rst | 29 ++ .../popframe.method.city_evaluation.rst | 29 ++ .../_autosummary/popframe.method.engineer.rst | 29 ++ .../popframe.method.landuse_assessment.rst | 29 ++ .../popframe.method.popuation_frame.rst | 29 ++ .../api/_autosummary/popframe.method.rst | 39 +++ .../popframe.method.spatial_inequality.rst | 29 ++ .../popframe.method.territory_evaluation.rst | 29 ++ .../popframe.models.geodataframe.rst | 30 ++ .../popframe.models.region.Region.rst | 35 ++ .../_autosummary/popframe.models.region.rst | 29 ++ .../api/_autosummary/popframe.models.rst | 33 ++ .../popframe.models.town.Town.rst | 62 ++++ .../api/_autosummary/popframe.models.town.rst | 29 ++ ...ame.preprocessing.adjacency_calculator.rst | 30 ++ .../popframe.preprocessing.level_filler.rst | 30 ++ ...pframe.preprocessing.population_filler.rst | 31 ++ .../_autosummary/popframe.preprocessing.rst | 34 ++ .../popframe.preprocessing.utils.rst | 33 ++ .../api/_autosummary/popframe.utils.const.rst | 23 ++ .../api/_autosummary/popframe.utils.rst | 31 ++ docs/source/api/index.rst | 15 +- docs/source/examples/.DS_Store | Bin 0 -> 6148 bytes docs/source/examples/aglomeration.nblink | 3 + docs/source/examples/anchor_settelment.nblink | 3 + docs/source/examples/blocks_generator.nblink | 3 - docs/source/examples/criterion_hex.nblink | 3 + docs/source/examples/engineer.nblink | 3 + docs/source/examples/index.rst | 17 +- .../source/examples/landuse_assessment.nblink | 3 + docs/source/examples/methods/index.rst | 14 - .../source/examples/spatial_inequality.nblink | 3 + .../examples/territory_evaluation.nblink | 3 + docs/source/index.rst | 37 +-- docs/source/popframe/contributing.rst | 133 +++----- docs/source/popframe/faq.rst | 29 +- ...ttelment.ipynb => anchor_settelment.ipynb} | 23 +- examples/criterion_hex.ipynb | 239 +++----------- examples/engineer.ipynb | 11 +- examples/landuse_assessment.ipynb | 7 + examples/spatial_inequality.ipynb | 12 +- examples/territory_evaluation.ipynb | 7 + popframe/method/spatial_inequality.py | 4 +- popframe/utils/__init__.py | 1 - 49 files changed, 1142 insertions(+), 501 deletions(-) create mode 100644 docs/source/api/_autosummary/popframe.method.aglomeration.rst create mode 100644 docs/source/api/_autosummary/popframe.method.anchor_settlement.rst create mode 100644 docs/source/api/_autosummary/popframe.method.base_method.rst create mode 100644 docs/source/api/_autosummary/popframe.method.city_evaluation.rst create mode 100644 docs/source/api/_autosummary/popframe.method.engineer.rst create mode 100644 docs/source/api/_autosummary/popframe.method.landuse_assessment.rst create mode 100644 docs/source/api/_autosummary/popframe.method.popuation_frame.rst create mode 100644 docs/source/api/_autosummary/popframe.method.rst create mode 100644 docs/source/api/_autosummary/popframe.method.spatial_inequality.rst create mode 100644 docs/source/api/_autosummary/popframe.method.territory_evaluation.rst create mode 100644 docs/source/api/_autosummary/popframe.models.geodataframe.rst create mode 100644 docs/source/api/_autosummary/popframe.models.region.Region.rst create mode 100644 docs/source/api/_autosummary/popframe.models.region.rst create mode 100644 docs/source/api/_autosummary/popframe.models.rst create mode 100644 docs/source/api/_autosummary/popframe.models.town.Town.rst create mode 100644 docs/source/api/_autosummary/popframe.models.town.rst create mode 100644 docs/source/api/_autosummary/popframe.preprocessing.adjacency_calculator.rst create mode 100644 docs/source/api/_autosummary/popframe.preprocessing.level_filler.rst create mode 100644 docs/source/api/_autosummary/popframe.preprocessing.population_filler.rst create mode 100644 docs/source/api/_autosummary/popframe.preprocessing.rst create mode 100644 docs/source/api/_autosummary/popframe.preprocessing.utils.rst create mode 100644 docs/source/api/_autosummary/popframe.utils.const.rst create mode 100644 docs/source/api/_autosummary/popframe.utils.rst create mode 100644 docs/source/examples/.DS_Store create mode 100644 docs/source/examples/aglomeration.nblink create mode 100644 docs/source/examples/anchor_settelment.nblink delete mode 100644 docs/source/examples/blocks_generator.nblink create mode 100644 docs/source/examples/criterion_hex.nblink create mode 100644 docs/source/examples/engineer.nblink create mode 100644 docs/source/examples/landuse_assessment.nblink delete mode 100644 docs/source/examples/methods/index.rst create mode 100644 docs/source/examples/spatial_inequality.nblink create mode 100644 docs/source/examples/territory_evaluation.nblink rename examples/{ anchor_settelment.ipynb => anchor_settelment.ipynb} (99%) diff --git a/README.rst b/README.rst index 6d29a1f..a40e47a 100644 --- a/README.rst +++ b/README.rst @@ -1,5 +1,5 @@ PopFrame -========== +======== .. logo-start @@ -12,188 +12,243 @@ PopFrame .. description-start -**PopFrame** is an open source library that includes methods for modeling the framework of a regional-level settlement system for assessing territories subject to reclamation/renovation, as well as modeling scenarios for changing regional facilities. The library is designed to form a universal information model of the region based on localities. +**EN:** +PopFrame is an open source library for modeling regional settlement systems and territory assessment. It provides tools for building a universal information model of a region based on localities, as well as for scenario modeling and analysis. + +**RU:** +PopFrame — это open source библиотека для моделирования каркаса расселения и оценки территорий. Она предоставляет инструменты для построения универсальной информационной модели региона на основе населённых пунктов, а также для сценарного моделирования и анализа. .. description-end -Table of Contents --------------------- +Table of Contents / Содержание +----------------------------- -- `Core features `_ -- `Installation `_ -- `Examples `_ -- `Project Structure `_ -- `Documentation `_ -- `Developing `_ -- `License `_ -- `Acknowledgments `_ -- `Contacts `_ +- `Core features <#core-features>`_ +- `Installation <#installation>`_ +- `Examples <#examples>`_ +- `Project Structure <#project-structure>`_ +- `Documentation <#documentation>`_ +- `Developing <#developing>`_ +- `License <#license>`_ +- `Acknowledgments <#acknowledgments>`_ +- `Contacts <#contacts>`_ -Core features -------------- +Core features / Основные возможности +----------------------------------- .. features-start -The library also provides tools for working with the information model of the region, which allow: +**EN:** +- Calculate indicators (population, birth rate, mortality) by municipal districts and municipalities. +- Evaluate territories in relation to the settlement system framework. +- Calculate the level of urbanization of the territory. +- Build agglomerations based on the settlement system framework. -- Calculate indicators (population, birth rate, mortality) by municipal districts and municipalities. -- Evaluate territories in relation to the framework of the settlement system. -- Calculating the level of urbanization of the territory. -- The construction of agglomerations based on the framework of the settlement system +**RU:** +- Расчёт показателей (население, рождаемость, смертность) по муниципальным районам и муниципалитетам. +- Оценка территорий относительно каркаса расселения. +- Расчёт уровня урбанизации территории. +- Построение агломераций на основе каркаса расселения. .. features-end -Installation ------------- +Installation / Установка +----------------------- .. installation-start -**PopFrame** can be installed with ``pip``: +**EN:** +PopFrame can be installed with ``pip``: :: - pip install popframe -.. installation-end - -Examples ------------- -Describe examples how it should work and should be used. -Images, GIFs and code cells are welcome. - - -Project Structure ------------------ - -The latest version of the library is available in the ``main`` branch. +**RU:** +Установить PopFrame можно через ``pip``: -The repository includes the following directories and modules: - -- `popframe `__ - - directory with the library code: - - - preprocessing - data preprocessing module - - models - entities' classes used in library - - method - library tool methods based on ``Region`` model - - utils - module containing utulity functions and consts - -- `tests `__ - ``pytest`` testing -- `examples `__ - examples of how methods work -- `docs `__ - - documentation sources - - -Documentation -------------- - -Detailed information and description of BlocksNet is available in -`documentation `__. +:: + pip install popframe +.. installation-end -Developing ----------- +Examples / Примеры +------------------ + +**EN:** +Below are examples for the main modules of PopFrame. + +**RU:** +Ниже приведены примеры для основных модулей PopFrame. + +**1. Region (models):** +```python +from popframe.models.region import Region +region = Region.from_pickle('data/region.pickle') +print(region.towns) +``` + +**2. PopulationFrame (method):** +```python +from popframe.method.popuation_frame import PopulationFrame +frame = PopulationFrame(region=region) +gdf = frame.build_circle_frame() +gdf.plot() +``` + +**3. AgglomerationBuilder (method):** +```python +from popframe.method.aglomeration import AgglomerationBuilder +builder = AgglomerationBuilder(region=region) +agglos = builder.get_agglomerations(time=80) +agglos.plot() +``` + +**4. CityPopulationScorer (method):** +```python +from popframe.method.city_evaluation import CityPopulationScorer +scorer = CityPopulationScorer(gdf_mo, gdf_hex) +results = scorer.run() +``` + +**5. InfrastructureAnalyzer (method):** +```python +from popframe.method.engineer import InfrastructureAnalyzer +analyzer = InfrastructureAnalyzer(infrastructure_gdf, assessment_areas_gdf) +results = analyzer.get_results() +``` + +**6. LevelFiller (preprocessing):** +```python +from popframe.preprocessing.level_filler import LevelFiller +filler = LevelFiller(towns=gdf_towns) +leveled = filler.fill_levels() +``` + +**7. PopulationFiller (preprocessing):** +```python +from popframe.preprocessing.population_filler import PopulationFiller +filler = PopulationFiller(units=gdf_units, towns=gdf_towns, adjacency_matrix=adj_matrix) +filled = filler.fill() +``` + +**8. Utils (const):** +```python +from popframe.utils.const import * +# Используйте константы для настройки методов +``` + +See more examples in the `examples/` directory and documentation. +Больше примеров — в папке `examples/` и в документации. + +Project Structure / Структура проекта +------------------------------------ + +**EN:** +- ``popframe`` — library code: + - ``preprocessing`` — data preprocessing + - ``models`` — core data models + - ``method`` — analytical methods + - ``utils`` — utility functions and constants +- ``examples`` — usage examples +- ``docs`` — documentation sources + +**RU:** +- ``popframe`` — код библиотеки: + - ``preprocessing`` — предобработка данных + - ``models`` — основные модели данных + - ``method`` — аналитические методы + - ``utils`` — утилиты и константы +- ``examples`` — примеры использования +- ``docs`` — исходники документации + +Documentation / Документация +---------------------------- + +**EN:** +Full documentation is available at: https://mvin8.github.io/PopFrame/ + +**RU:** +Полная документация: https://mvin8.github.io/PopFrame/ + +Developing / Разработка +---------------------- .. developing-start -To start developing the library, one must perform following actions: - +**EN:** +To start developing PopFrame: 1. Clone the repository: :: - $ git clone https://github.com/Mvin8/PopFrame - -2. (Optional) Create a virtual environment as the library demands exact package versions: +2. (Optional) Create a virtual environment: :: - $ make venv - - Activate the virtual environment if you created one: - :: - $ source .venv/bin/activate - 3. Install the library in editable mode with development dependencies: :: - $ make install-dev - 4. Install pre-commit hooks: :: - $ pre-commit install - -5. Create a new branch based on ``develop``: +5. Create a new branch: :: - $ git checkout -b develop - -6. Start making changes on your newly created branch, remembering to - never work on the ``master`` branch! Work on this copy on your - computer using Git to do the version control. - -7. Update - `tests `__ - according to your changes and run the following command: - +6. Make changes, update tests and documentation, and run: :: + $ make test +7. Commit and push your changes, then open a Pull Request. - $ make test - - Make sure that all tests pass. - -8. Update the - `documentation `__ - and **README** according to your changes. - -11. When you're done editing and local testing, run: - +**RU:** +Для начала разработки PopFrame: +1. Клонируйте репозиторий: :: - - $ git add modified_files - $ git commit - - to record your changes in Git, then push them to GitHub with: - + $ git clone https://github.com/Mvin8/PopFrame +2. (Опционально) создайте виртуальное окружение: :: - - $ git push -u origin my-contribution - - Finally, go to the web page of your fork of the BlocksNet repo, and click - 'Pull Request' (PR) to send your changes to the maintainers for review. + $ make venv + $ source .venv/bin/activate +3. Установите библиотеку в editable-режиме с dev-зависимостями: + :: + $ make install-dev +4. Установите pre-commit хуки: + :: + $ pre-commit install +5. Создайте новую ветку: + :: + $ git checkout -b develop +6. Вносите изменения, обновляйте тесты и документацию, запускайте: + :: + $ make test +7. Зафиксируйте и отправьте изменения, откройте Pull Request. .. developing-end -Check out the... - +License / Лицензия +------------------ -License -------- +BSD-3-Clause license. See LICENSE file. -The project has `BSD-3-Clause license <./LICENSE>`__ - -Acknowledgments ---------------- +Acknowledgments / Благодарности +------------------------------- .. acknowledgments-start -The library was developed as the main part of the ITMO University -project... +**EN:** +PopFrame was developed as part of the ITMO University project. +**RU:** +PopFrame разработан в рамках проекта Университета ИТМО. -Contacts --------- +.. acknowledgments-end -.. contacts-start +Contacts / Контакты +------------------- -You can contact us: +.. contacts-start -- `NCCR `__ - National - Center for Cognitive Research -- `IDU `__ - Institute of - Design and Urban Studies -- `Maksim Natykin `__ - lead software engineer +- `NCCR `__ — National Center for Cognitive Research +- `IDU `__ — Institute of Design and Urban Studies +- `Maksim Natykin `__ — lead software engineer .. contacts-end diff --git a/docs/requirements.txt b/docs/requirements.txt index cd5e6b2..79b03fa 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -25,7 +25,7 @@ scikit-learn==1.2.2 scipy==1.10.1 seaborn==0.12.2 shapely==2.0.1 -retrying==1.3.4, +retrying==1.3.4 dill==0.3.8 six==1.16.0 sphinx==7.1.2 diff --git a/docs/source/about_us.rst b/docs/source/about_us.rst index f1affd5..ae28c75 100644 --- a/docs/source/about_us.rst +++ b/docs/source/about_us.rst @@ -1,26 +1,23 @@ -About us -======== +About us / О нас +================ -.. .. image:: ../img/idu.jpg -.. :alt: IDU team +**EN:** +PopFrame is developed and maintained by the `IDU `__ team at ITMO University. The Institute of Design and Urban Studies (IDU) is an educational and research unit focused on interdisciplinary competencies and scientific approaches to solving complex urban problems using IT, sustainability, and social orientation principles. -The BlocksNet is developed and maintained by the `IDU `__ team. +**RU:** +PopFrame разрабатывается и поддерживается командой `IDU `__ (Институт дизайна и урбанистики ИТМО). IDU — это образовательное и проектно-исследовательское подразделение, развивающее междисциплинарные компетенции и научные подходы к решению сложных городских задач с помощью ИТ, принципов устойчивого развития и социальной ориентированности. -The Institute of Design and Urban Studies (IDU) is an educational and project-research -unit of ITMO University aimed at developing interdisciplinary competencies and scientific -approach for solving complex urban problems using information technologies based on the -principles of sustainability and social orientation. +.. image:: ../img/idu.jpg + :alt: IDU team -Contacts --------- +Contacts / Контакты +------------------- .. include:: ../../README.rst :start-after: .. contacts-start :end-before: .. contacts-end -Publications ------------- +Publications / Публикации +------------------------- -.. .. include:: ../../README.rst -.. :start-after: .. publications-start -.. :end-before: .. publications-end +(Добавьте сюда список публикаций, связанных с PopFrame, если есть) diff --git a/docs/source/api/_autosummary/popframe.method.aglomeration.rst b/docs/source/api/_autosummary/popframe.method.aglomeration.rst new file mode 100644 index 0000000..9755aaa --- /dev/null +++ b/docs/source/api/_autosummary/popframe.method.aglomeration.rst @@ -0,0 +1,29 @@ +popframe.method.aglomeration +============================ + +.. automodule:: popframe.method.aglomeration + + + + + + + + + + + + .. rubric:: Classes + + .. autosummary:: + + AgglomerationBuilder + + + + + + + + + diff --git a/docs/source/api/_autosummary/popframe.method.anchor_settlement.rst b/docs/source/api/_autosummary/popframe.method.anchor_settlement.rst new file mode 100644 index 0000000..77c8f7f --- /dev/null +++ b/docs/source/api/_autosummary/popframe.method.anchor_settlement.rst @@ -0,0 +1,29 @@ +popframe.method.anchor\_settlement +================================== + +.. automodule:: popframe.method.anchor_settlement + + + + + + + + + + + + .. rubric:: Classes + + .. autosummary:: + + AnchorSettlementBuilder + + + + + + + + + diff --git a/docs/source/api/_autosummary/popframe.method.base_method.rst b/docs/source/api/_autosummary/popframe.method.base_method.rst new file mode 100644 index 0000000..594d57a --- /dev/null +++ b/docs/source/api/_autosummary/popframe.method.base_method.rst @@ -0,0 +1,29 @@ +popframe.method.base\_method +============================ + +.. automodule:: popframe.method.base_method + + + + + + + + + + + + .. rubric:: Classes + + .. autosummary:: + + BaseMethod + + + + + + + + + diff --git a/docs/source/api/_autosummary/popframe.method.city_evaluation.rst b/docs/source/api/_autosummary/popframe.method.city_evaluation.rst new file mode 100644 index 0000000..11ecc88 --- /dev/null +++ b/docs/source/api/_autosummary/popframe.method.city_evaluation.rst @@ -0,0 +1,29 @@ +popframe.method.city\_evaluation +================================ + +.. automodule:: popframe.method.city_evaluation + + + + + + + + + + + + .. rubric:: Classes + + .. autosummary:: + + CityPopulationScorer + + + + + + + + + diff --git a/docs/source/api/_autosummary/popframe.method.engineer.rst b/docs/source/api/_autosummary/popframe.method.engineer.rst new file mode 100644 index 0000000..a81c1b8 --- /dev/null +++ b/docs/source/api/_autosummary/popframe.method.engineer.rst @@ -0,0 +1,29 @@ +popframe.method.engineer +======================== + +.. automodule:: popframe.method.engineer + + + + + + + + + + + + .. rubric:: Classes + + .. autosummary:: + + InfrastructureAnalyzer + + + + + + + + + diff --git a/docs/source/api/_autosummary/popframe.method.landuse_assessment.rst b/docs/source/api/_autosummary/popframe.method.landuse_assessment.rst new file mode 100644 index 0000000..5383591 --- /dev/null +++ b/docs/source/api/_autosummary/popframe.method.landuse_assessment.rst @@ -0,0 +1,29 @@ +popframe.method.landuse\_assessment +=================================== + +.. automodule:: popframe.method.landuse_assessment + + + + + + + + + + + + .. rubric:: Classes + + .. autosummary:: + + LandUseAssessment + + + + + + + + + diff --git a/docs/source/api/_autosummary/popframe.method.popuation_frame.rst b/docs/source/api/_autosummary/popframe.method.popuation_frame.rst new file mode 100644 index 0000000..65e80eb --- /dev/null +++ b/docs/source/api/_autosummary/popframe.method.popuation_frame.rst @@ -0,0 +1,29 @@ +popframe.method.popuation\_frame +================================ + +.. automodule:: popframe.method.popuation_frame + + + + + + + + + + + + .. rubric:: Classes + + .. autosummary:: + + PopulationFrame + + + + + + + + + diff --git a/docs/source/api/_autosummary/popframe.method.rst b/docs/source/api/_autosummary/popframe.method.rst new file mode 100644 index 0000000..ab21b51 --- /dev/null +++ b/docs/source/api/_autosummary/popframe.method.rst @@ -0,0 +1,39 @@ +popframe.method +=============== + +.. automodule:: popframe.method + + + + + + + + + + + + + + + + + + + +.. rubric:: Modules + +.. autosummary:: + :toctree: + :recursive: + + popframe.method.aglomeration + popframe.method.anchor_settlement + popframe.method.base_method + popframe.method.city_evaluation + popframe.method.engineer + popframe.method.landuse_assessment + popframe.method.popuation_frame + popframe.method.spatial_inequality + popframe.method.territory_evaluation + diff --git a/docs/source/api/_autosummary/popframe.method.spatial_inequality.rst b/docs/source/api/_autosummary/popframe.method.spatial_inequality.rst new file mode 100644 index 0000000..79dacb4 --- /dev/null +++ b/docs/source/api/_autosummary/popframe.method.spatial_inequality.rst @@ -0,0 +1,29 @@ +popframe.method.spatial\_inequality +=================================== + +.. automodule:: popframe.method.spatial_inequality + + + + + + + + + + + + .. rubric:: Classes + + .. autosummary:: + + SpatialInequalityCalculator + + + + + + + + + diff --git a/docs/source/api/_autosummary/popframe.method.territory_evaluation.rst b/docs/source/api/_autosummary/popframe.method.territory_evaluation.rst new file mode 100644 index 0000000..e08d9d6 --- /dev/null +++ b/docs/source/api/_autosummary/popframe.method.territory_evaluation.rst @@ -0,0 +1,29 @@ +popframe.method.territory\_evaluation +===================================== + +.. automodule:: popframe.method.territory_evaluation + + + + + + + + + + + + .. rubric:: Classes + + .. autosummary:: + + TerritoryEvaluation + + + + + + + + + diff --git a/docs/source/api/_autosummary/popframe.models.geodataframe.rst b/docs/source/api/_autosummary/popframe.models.geodataframe.rst new file mode 100644 index 0000000..9cad260 --- /dev/null +++ b/docs/source/api/_autosummary/popframe.models.geodataframe.rst @@ -0,0 +1,30 @@ +popframe.models.geodataframe +============================ + +.. automodule:: popframe.models.geodataframe + + + + + + + + + + + + .. rubric:: Classes + + .. autosummary:: + + BaseRow + GeoDataFrame + + + + + + + + + diff --git a/docs/source/api/_autosummary/popframe.models.region.Region.rst b/docs/source/api/_autosummary/popframe.models.region.Region.rst new file mode 100644 index 0000000..2ddc863 --- /dev/null +++ b/docs/source/api/_autosummary/popframe.models.region.Region.rst @@ -0,0 +1,35 @@ +popframe.models.region.Region +============================= + +.. currentmodule:: popframe.models.region + +.. autoclass:: Region + + + .. automethod:: __init__ + + + .. rubric:: Methods + + .. autosummary:: + + ~Region.__init__ + ~Region.from_pickle + ~Region.get_towns_gdf + ~Region.get_update_towns_gdf + ~Region.to_pickle + ~Region.validate_accessibility_matrix + ~Region.validate_region + ~Region.validate_towns + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~Region.towns + + \ No newline at end of file diff --git a/docs/source/api/_autosummary/popframe.models.region.rst b/docs/source/api/_autosummary/popframe.models.region.rst new file mode 100644 index 0000000..738c20a --- /dev/null +++ b/docs/source/api/_autosummary/popframe.models.region.rst @@ -0,0 +1,29 @@ +popframe.models.region +====================== + +.. automodule:: popframe.models.region + + + + + + + + + + + + .. rubric:: Classes + + .. autosummary:: + + Region + + + + + + + + + diff --git a/docs/source/api/_autosummary/popframe.models.rst b/docs/source/api/_autosummary/popframe.models.rst new file mode 100644 index 0000000..1cbf2a4 --- /dev/null +++ b/docs/source/api/_autosummary/popframe.models.rst @@ -0,0 +1,33 @@ +popframe.models +=============== + +.. automodule:: popframe.models + + + + + + + + + + + + + + + + + + + +.. rubric:: Modules + +.. autosummary:: + :toctree: + :recursive: + + popframe.models.geodataframe + popframe.models.region + popframe.models.town + diff --git a/docs/source/api/_autosummary/popframe.models.town.Town.rst b/docs/source/api/_autosummary/popframe.models.town.Town.rst new file mode 100644 index 0000000..710a1ca --- /dev/null +++ b/docs/source/api/_autosummary/popframe.models.town.Town.rst @@ -0,0 +1,62 @@ +popframe.models.town.Town +========================= + +.. currentmodule:: popframe.models.town + +.. autoclass:: Town + + + .. automethod:: __init__ + + + .. rubric:: Methods + + .. autosummary:: + + ~Town.__init__ + ~Town.construct + ~Town.copy + ~Town.dict + ~Town.from_gdf + ~Town.from_orm + ~Town.json + ~Town.model_construct + ~Town.model_copy + ~Town.model_dump + ~Town.model_dump_json + ~Town.model_json_schema + ~Town.model_parametrized_name + ~Town.model_post_init + ~Town.model_rebuild + ~Town.model_validate + ~Town.model_validate_json + ~Town.model_validate_strings + ~Town.parse_file + ~Town.parse_obj + ~Town.parse_raw + ~Town.schema + ~Town.schema_json + ~Town.to_dict + ~Town.update_forward_refs + ~Town.validate + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~Town.model_computed_fields + ~Town.model_config + ~Town.model_extra + ~Town.model_fields + ~Town.model_fields_set + ~Town.id + ~Town.name + ~Town.level + ~Town.population + ~Town.geometry + + \ No newline at end of file diff --git a/docs/source/api/_autosummary/popframe.models.town.rst b/docs/source/api/_autosummary/popframe.models.town.rst new file mode 100644 index 0000000..9c3f97e --- /dev/null +++ b/docs/source/api/_autosummary/popframe.models.town.rst @@ -0,0 +1,29 @@ +popframe.models.town +==================== + +.. automodule:: popframe.models.town + + + + + + + + + + + + .. rubric:: Classes + + .. autosummary:: + + Town + + + + + + + + + diff --git a/docs/source/api/_autosummary/popframe.preprocessing.adjacency_calculator.rst b/docs/source/api/_autosummary/popframe.preprocessing.adjacency_calculator.rst new file mode 100644 index 0000000..c3376fa --- /dev/null +++ b/docs/source/api/_autosummary/popframe.preprocessing.adjacency_calculator.rst @@ -0,0 +1,30 @@ +popframe.preprocessing.adjacency\_calculator +============================================ + +.. automodule:: popframe.preprocessing.adjacency_calculator + + + + + + + + + + + + .. rubric:: Classes + + .. autosummary:: + + AdjacencyCalculator + BlockRow + + + + + + + + + diff --git a/docs/source/api/_autosummary/popframe.preprocessing.level_filler.rst b/docs/source/api/_autosummary/popframe.preprocessing.level_filler.rst new file mode 100644 index 0000000..e85eb94 --- /dev/null +++ b/docs/source/api/_autosummary/popframe.preprocessing.level_filler.rst @@ -0,0 +1,30 @@ +popframe.preprocessing.level\_filler +==================================== + +.. automodule:: popframe.preprocessing.level_filler + + + + + + + + + + + + .. rubric:: Classes + + .. autosummary:: + + LevelFiller + TownRow + + + + + + + + + diff --git a/docs/source/api/_autosummary/popframe.preprocessing.population_filler.rst b/docs/source/api/_autosummary/popframe.preprocessing.population_filler.rst new file mode 100644 index 0000000..be493b5 --- /dev/null +++ b/docs/source/api/_autosummary/popframe.preprocessing.population_filler.rst @@ -0,0 +1,31 @@ +popframe.preprocessing.population\_filler +========================================= + +.. automodule:: popframe.preprocessing.population_filler + + + + + + + + + + + + .. rubric:: Classes + + .. autosummary:: + + PopulationFiller + TownRow + UnitRow + + + + + + + + + diff --git a/docs/source/api/_autosummary/popframe.preprocessing.rst b/docs/source/api/_autosummary/popframe.preprocessing.rst new file mode 100644 index 0000000..23fcd94 --- /dev/null +++ b/docs/source/api/_autosummary/popframe.preprocessing.rst @@ -0,0 +1,34 @@ +popframe.preprocessing +====================== + +.. automodule:: popframe.preprocessing + + + + + + + + + + + + + + + + + + + +.. rubric:: Modules + +.. autosummary:: + :toctree: + :recursive: + + popframe.preprocessing.adjacency_calculator + popframe.preprocessing.level_filler + popframe.preprocessing.population_filler + popframe.preprocessing.utils + diff --git a/docs/source/api/_autosummary/popframe.preprocessing.utils.rst b/docs/source/api/_autosummary/popframe.preprocessing.utils.rst new file mode 100644 index 0000000..b838b38 --- /dev/null +++ b/docs/source/api/_autosummary/popframe.preprocessing.utils.rst @@ -0,0 +1,33 @@ +popframe.preprocessing.utils +============================ + +.. automodule:: popframe.preprocessing.utils + + + + + + + + .. rubric:: Functions + + .. autosummary:: + + drop_contained_geometries + fill_holes + filter_bottlenecks + get_projected_crs + verbose_print + + + + + + + + + + + + + diff --git a/docs/source/api/_autosummary/popframe.utils.const.rst b/docs/source/api/_autosummary/popframe.utils.const.rst new file mode 100644 index 0000000..5b73007 --- /dev/null +++ b/docs/source/api/_autosummary/popframe.utils.const.rst @@ -0,0 +1,23 @@ +popframe.utils.const +==================== + +.. automodule:: popframe.utils.const + + + + + + + + + + + + + + + + + + + diff --git a/docs/source/api/_autosummary/popframe.utils.rst b/docs/source/api/_autosummary/popframe.utils.rst new file mode 100644 index 0000000..cddb27c --- /dev/null +++ b/docs/source/api/_autosummary/popframe.utils.rst @@ -0,0 +1,31 @@ +popframe.utils +============== + +.. automodule:: popframe.utils + + + + + + + + + + + + + + + + + + + +.. rubric:: Modules + +.. autosummary:: + :toctree: + :recursive: + + popframe.utils.const + diff --git a/docs/source/api/index.rst b/docs/source/api/index.rst index 7ccbfc3..e0c5ec1 100644 --- a/docs/source/api/index.rst +++ b/docs/source/api/index.rst @@ -1,7 +1,16 @@ -API documentation -================= +API documentation / Документация по API +======================================= -The modules of PopFrame are listed below: +**EN:** +Below are the main modules of PopFrame with brief descriptions. + +**RU:** +Ниже перечислены основные модули PopFrame с краткими описаниями. + +- **popframe.preprocessing** — EN: Data preprocessing tools. RU: Инструменты для предобработки данных. +- **popframe.models** — EN: Core data models (Region, Town, etc). RU: Основные модели данных (Регион, Город и др.). +- **popframe.method** — EN: Methods for territory and settlement system analysis. RU: Методы анализа территорий и каркаса расселения. +- **popframe.utils** — EN: Utility functions and constants. RU: Вспомогательные функции и константы. .. autosummary:: :toctree: _autosummary diff --git a/docs/source/examples/.DS_Store b/docs/source/examples/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..5008ddfcf53c02e82d7eee2e57c38e5672ef89f6 GIT binary patch literal 6148 zcmeH~Jr2S!425mzP>H1@V-^m;4Wg<&0T*E43hX&L&p$$qDprKhvt+--jT7}7np#A3 zem<@ulZcFPQ@L2!n>{z**++&mCkOWA81W14cNZlEfg7;MkzE(HCqgga^y>{tEnwC%0;vJ&^%eQ zLs35+`xjp>T0 + Опорные поселения + Критерий для hex + Инженерная инфраструктура + Оценка землепользования + Пространственное неравенство + Оценка территории diff --git a/docs/source/examples/landuse_assessment.nblink b/docs/source/examples/landuse_assessment.nblink new file mode 100644 index 0000000..d8d9990 --- /dev/null +++ b/docs/source/examples/landuse_assessment.nblink @@ -0,0 +1,3 @@ +{ + "path": "../../../examples/landuse_assessment.ipynb" +} \ No newline at end of file diff --git a/docs/source/examples/methods/index.rst b/docs/source/examples/methods/index.rst deleted file mode 100644 index 532099f..0000000 --- a/docs/source/examples/methods/index.rst +++ /dev/null @@ -1,14 +0,0 @@ -Examples -========= - -The examples below may help with getting used to the library. - -.. toctree:: - :glob: - :maxdepth: 2 - - pipeline - blocks_generator - graph_generator - city - methods/index diff --git a/docs/source/examples/spatial_inequality.nblink b/docs/source/examples/spatial_inequality.nblink new file mode 100644 index 0000000..f531f1b --- /dev/null +++ b/docs/source/examples/spatial_inequality.nblink @@ -0,0 +1,3 @@ +{ + "path": "../../../examples/spatial_inequality.ipynb" +} \ No newline at end of file diff --git a/docs/source/examples/territory_evaluation.nblink b/docs/source/examples/territory_evaluation.nblink new file mode 100644 index 0000000..7e9b0b3 --- /dev/null +++ b/docs/source/examples/territory_evaluation.nblink @@ -0,0 +1,3 @@ +{ + "path": "../../../examples/territory_evaluation.ipynb" +} \ No newline at end of file diff --git a/docs/source/index.rst b/docs/source/index.rst index 144cd8a..9a44254 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -1,16 +1,14 @@ -Welcome to PopFrame documentation! +Welcome to PopFrame documentation! / Добро пожаловать в документацию PopFrame! =================================== -.. .. include:: ../../README.rst -.. :start-after: .. logo-start -.. :end-before: .. logo-end +**EN:** +This documentation covers the main features, API, and usage examples of PopFrame. -.. .. include:: ../../README.rst -.. :start-after: .. description-start -.. :end-before: .. description-end +**RU:** +В этой документации представлены основные возможности, API и примеры использования PopFrame. -Documentation: --------------- +Documentation / Документация: +----------------------------- .. toctree:: :maxdepth: 2 @@ -20,16 +18,17 @@ Documentation: api/index about_us -Features: ---------- +Sections / Разделы: +------------------- -.. .. include:: ../../README.rst -.. :start-after: .. features-start -.. :end-before: .. features-end +- **popframe** — EN: Library modules overview. RU: Обзор модулей библиотеки. +- **examples** — EN: Usage examples. RU: Примеры использования. +- **api** — EN: API reference. RU: Справочник по API. +- **about_us** — EN: About the team. RU: О команде. -Acknowledgements ----------------- +Acknowledgements / Благодарности +------------------------------- -.. .. include:: ../../README.rst -.. :start-after: .. acknowledgments-start -.. :end-before: .. acknowledgments-end \ No newline at end of file +.. include:: ../../README.rst + :start-after: .. acknowledgments-start + :end-before: .. acknowledgments-end \ No newline at end of file diff --git a/docs/source/popframe/contributing.rst b/docs/source/popframe/contributing.rst index 800818c..6f4ac12 100644 --- a/docs/source/popframe/contributing.rst +++ b/docs/source/popframe/contributing.rst @@ -1,108 +1,57 @@ -Contributing -============ +Contributing / Вклад в проект +============================ -We welcome you to `check the existing -issues `__ for bugs or -enhancements to work on. If you have an idea for an extension to BlocksNet, -please `file a new -issue `__ so we can -discuss it. +**EN:** +We welcome your contributions to PopFrame! Please check the existing issues for bugs or enhancements to work on. If you have an idea for an extension, file a new issue so we can discuss it. Familiarize yourself with the project layout before making major contributions. -Make sure to familiarize yourself with the project layout before making -any major contributions. +**RU:** +Мы приветствуем ваш вклад в PopFrame! Ознакомьтесь с существующими задачами (issues) для поиска багов или улучшений. Если у вас есть идея для расширения, создайте новую задачу для обсуждения. Перед крупными изменениями ознакомьтесь со структурой проекта. -.. How to contribute -.. ----------------- +How to contribute / Как внести вклад +------------------------------------ -.. .. include:: ../../../README.rst -.. :start-after: .. developing-start -.. :end-before: .. developing-end +.. include:: ../../../README.rst + :start-after: .. developing-start + :end-before: .. developing-end -(If it looks confusing to you, then look up the `Git -documentation `__ on the web.) +Before submitting your pull request / Перед отправкой pull request +----------------------------------------------------------------- -Before submitting your pull request ------------------------------------ +**EN:** +- Update the documentation and README if your changes affect them. +- Update or add tests for your code. +- Make sure your code is properly commented and documented. +- If you add dependencies, ensure they are easy to install via pip and support Python 3. -Before you submit a pull request for your contribution, please work -through this checklist to make sure that you have done everything -necessary so we can efficiently review and accept your changes. +**RU:** +- Обновите документацию и README, если ваши изменения их затрагивают. +- Добавьте или обновите тесты для вашего кода. +- Убедитесь, что код снабжён комментариями и docstring. +- Новые зависимости должны легко устанавливаться через pip и поддерживать Python 3. -If your contribution changes BlocksNet in any way: +Contribute to the documentation / Вклад в документацию +------------------------------------------------------ -- Update the - `documentation `__ - so all of your changes are reflected there. +**EN:** +All documentation is created with Sphinx autodoc. Use .. automodule:: for module documentation. Add new files to the toctree in api/index.rst. -- Update the - `README `__ - if anything there has changed. +**RU:** +Вся документация создаётся с помощью Sphinx autodoc. Для описания модулей используйте .. automodule:: . Новые файлы добавляйте в toctree в api/index.rst. -If your contribution involves any code changes: +After submitting your pull request / После отправки pull request +--------------------------------------------------------------- -- Update the `project unit` tests to test your code changes. +**EN:** +- Automated tests and code quality checks will run. +- Address any errors if checks fail. -- Make sure that your code is properly commented with - `docstrings `__ and - comments explaining your rationale behind non-obvious coding - practices. +**RU:** +- Будут запущены автоматические тесты и проверки качества кода. +- Исправьте ошибки, если проверки не пройдены. -If your contribution requires a new library dependency: +Acknowledgements / Благодарности +-------------------------------- -- Double-check that the new dependency is easy to install via ``pip`` - or Anaconda and supports Python 3. If the dependency requires a - complicated installation, then we most likely won't merge your - changes because we want to keep BlocksNet easy to install. +This guide is based on the TPOT Framework contribution guide. -Contribute to the documentation -------------------------------- -Take care of the documentation. - -All the documentation is created with the Sphinx autodoc feature. Use .. -automodule:: section which describes all the code in the module. - -- If a new package with several scripts: - - 1. Go to `docs/source/BlocksNet `__ and create new ``your_name_for_file.rst`` file. - - 2. Add a Header underlined with “=” sign. It’s crucial. - - .. 3. Add automodule description for each of your scripts. :: - - .. .. automodule:: blocksnet.your.first.script.path - - .. .. automodule:: blocksnet.your.second.script.path - .. ... - - 4. Add your_name_for_file to the toctree at ``docs/source/blocksnet/api/index.rst`` - -- If a new module to the existed package: - - Most of the sections are already described in `docs/source/BlocksNet `__ , so you can: - - - choose the most appropriate and repeat 3-d step from the previous section. - - or create a new one and repeat 2-3 steps from the previous section. - -- If a new function or a class to the existing module: - - Be happy. Everything is already done for you. - -After submitting your pull request ----------------------------------- - -After submitting your pull request, -`Travis-CI `__ will automatically run unit tests -on your changes and make sure that your updated code builds and runs on -Python 3. We also use services that automatically check code quality and -test coverage. - -Check back shortly after submitting your pull request to make sure that -your code passes these checks. If any of the checks come back with a red -X, then do your best to address the errors. - -Acknowledgements ----------------- - -This document guide is based at well-written `TPOT Framework -contribution -guide `__. \ No newline at end of file +Данный гайд основан на руководстве по вкладу в TPOT Framework. \ No newline at end of file diff --git a/docs/source/popframe/faq.rst b/docs/source/popframe/faq.rst index 05b4053..177b8bb 100644 --- a/docs/source/popframe/faq.rst +++ b/docs/source/popframe/faq.rst @@ -1,7 +1,26 @@ -FAQ -=== -Frequently asked questions and answers +FAQ / Часто задаваемые вопросы +============================= -.. topic:: What is PopFrame? +**EN:** +Frequently asked questions and answers about PopFrame. - *BlocksNet is an open-source library for generating master plan requirements for urban areas.* +**RU:** +Часто задаваемые вопросы и ответы о PopFrame. + +.. topic:: What is PopFrame? / Что такое PopFrame? + + **EN:** PopFrame is an open-source library for modeling regional settlement systems and territory assessment. + + **RU:** PopFrame — это open-source библиотека для моделирования каркаса расселения и оценки территорий. + +.. topic:: How do I install PopFrame? / Как установить PopFrame? + + **EN:** Use pip: pip install popframe + + **RU:** Используйте pip: pip install popframe + +.. topic:: Where can I find examples? / Где найти примеры? + + **EN:** See the examples/ directory in the repository or the documentation section "Examples". + + **RU:** Смотрите папку examples/ в репозитории или раздел "Примеры" в документации. diff --git a/examples/ anchor_settelment.ipynb b/examples/anchor_settelment.ipynb similarity index 99% rename from examples/ anchor_settelment.ipynb rename to examples/anchor_settelment.ipynb index 3a41edd..a86b870 100644 --- a/examples/ anchor_settelment.ipynb +++ b/examples/anchor_settelment.ipynb @@ -1,5 +1,12 @@ { "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Опорные населенные пункты" + ] + }, { "cell_type": "code", "execution_count": 3, @@ -28,14 +35,14 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "# Проепроцессинг" + "## Проепроцессинг" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "## Получение территорий" + "### Получение территорий" ] }, { @@ -78,7 +85,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "## Данные по соц категориям" + "### Данные по соц категориям" ] }, { @@ -178,7 +185,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "## Функция поиска родительской территории по типу" + "### Функция поиска родительской территории по типу" ] }, { @@ -237,7 +244,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "## Получение данных из TownsNet" + "### Получение данных из TownsNet" ] }, { @@ -306,7 +313,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "## Получаем данные по городам и ГПСП" + "### Получаем данные по городам и ГПСП" ] }, { @@ -2577,14 +2584,14 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "# Работа метода" + "## Работа метода" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "## Границы опорных пунктов" + "### Границы опорных пунктов" ] }, { diff --git a/examples/criterion_hex.ipynb b/examples/criterion_hex.ipynb index cda26c1..0955810 100644 --- a/examples/criterion_hex.ipynb +++ b/examples/criterion_hex.ipynb @@ -4,7 +4,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "## Тест" + "# Оценка территории по критерию для гексагональной сетки" ] }, { @@ -69,19 +69,19 @@ " \n", " \n", " 0\n", - " POLYGON ((30.06574 59.6709, 30.07379 59.67194,...\n", + " POLYGON ((30.06574 59.67090, 30.07379 59.67194...\n", " 157558\n", " {}\n", " \n", " \n", " 1\n", - " POLYGON ((30.0877 60.08939, 30.09047 60.09382,...\n", + " POLYGON ((30.08770 60.08939, 30.09047 60.09382...\n", " 157559\n", " {}\n", " \n", " \n", " 2\n", - " POLYGON ((30.37948 59.7927, 30.38759 59.79372,...\n", + " POLYGON ((30.37948 59.79270, 30.38759 59.79372...\n", " 157560\n", " {}\n", " \n", @@ -93,7 +93,7 @@ " \n", " \n", " 4\n", - " POLYGON ((30.24918 60.02467, 30.25198 60.0291,...\n", + " POLYGON ((30.24918 60.02467, 30.25198 60.02910...\n", " 157562\n", " {}\n", " \n", @@ -123,7 +123,7 @@ " \n", " \n", " 2532\n", - " POLYGON ((30.74536 59.757, 30.74007 59.76043, ...\n", + " POLYGON ((30.74536 59.75700, 30.74007 59.76043...\n", " 160090\n", " {}\n", " \n", @@ -140,16 +140,16 @@ ], "text/plain": [ " geometry hexagon_id properties\n", - "0 POLYGON ((30.06574 59.6709, 30.07379 59.67194,... 157558 {}\n", - "1 POLYGON ((30.0877 60.08939, 30.09047 60.09382,... 157559 {}\n", - "2 POLYGON ((30.37948 59.7927, 30.38759 59.79372,... 157560 {}\n", + "0 POLYGON ((30.06574 59.67090, 30.07379 59.67194... 157558 {}\n", + "1 POLYGON ((30.08770 60.08939, 30.09047 60.09382... 157559 {}\n", + "2 POLYGON ((30.37948 59.79270, 30.38759 59.79372... 157560 {}\n", "3 POLYGON ((30.66727 59.76362, 30.66198 59.76704... 157561 {}\n", - "4 POLYGON ((30.24918 60.02467, 30.25198 60.0291,... 157562 {}\n", + "4 POLYGON ((30.24918 60.02467, 30.25198 60.02910... 157562 {}\n", "... ... ... ...\n", "2529 POLYGON ((30.45791 60.02272, 30.46608 60.02376... 160087 {}\n", "2530 POLYGON ((30.23231 59.84322, 30.23764 59.83983... 160088 {}\n", "2531 POLYGON ((29.50097 60.20315, 29.49286 60.20206... 160089 {}\n", - "2532 POLYGON ((30.74536 59.757, 30.74007 59.76043, ... 160090 {}\n", + "2532 POLYGON ((30.74536 59.75700, 30.74007 59.76043... 160090 {}\n", "2533 POLYGON ((30.17198 60.10435, 30.17477 60.10878... 160091 {}\n", "\n", "[2534 rows x 3 columns]" @@ -248,7 +248,7 @@ " \n", " \n", " 1\n", - " MULTIPOLYGON (((30.17787 59.94437, 30.1779 59....\n", + " MULTIPOLYGON (((30.17787 59.94437, 30.17790 59...\n", " 3145\n", " Василеостровский район\n", " [{'name_full': 'Численность населения', 'measu...\n", @@ -328,7 +328,7 @@ " \n", " \n", " 11\n", - " MULTIPOLYGON (((30.36331 59.91387, 30.3635 59....\n", + " MULTIPOLYGON (((30.36331 59.91387, 30.36350 59...\n", " 3146\n", " Невский район\n", " [{'name_full': 'Численность населения', 'measu...\n", @@ -389,7 +389,7 @@ "text/plain": [ " geometry territory_id \\\n", "0 MULTIPOLYGON (((30.25023 59.90129, 30.25112 59... 3153 \n", - "1 MULTIPOLYGON (((30.17787 59.94437, 30.1779 59.... 3145 \n", + "1 MULTIPOLYGON (((30.17787 59.94437, 30.17790 59... 3145 \n", "2 MULTIPOLYGON (((30.07078 60.09625, 30.07421 60... 3144 \n", "3 MULTIPOLYGON (((30.34398 59.97727, 30.34399 59... 3152 \n", "4 MULTIPOLYGON (((30.16152 59.87428, 30.16152 59... 3151 \n", @@ -399,7 +399,7 @@ "8 MULTIPOLYGON (((29.54157 60.04248, 29.54184 60... 3141 \n", "9 MULTIPOLYGON (((29.42576 60.19074, 29.42719 60... 3140 \n", "10 MULTIPOLYGON (((30.19877 59.80161, 30.19888 59... 3148 \n", - "11 MULTIPOLYGON (((30.36331 59.91387, 30.3635 59.... 3146 \n", + "11 MULTIPOLYGON (((30.36331 59.91387, 30.36350 59... 3146 \n", "12 MULTIPOLYGON (((30.21013 59.97234, 30.21024 59... 3142 \n", "13 MULTIPOLYGON (((29.64754 59.92986, 29.64792 59... 3147 \n", "14 MULTIPOLYGON (((29.95527 60.03782, 29.95528 60... 3139 \n", @@ -539,7 +539,7 @@ " \n", " \n", " 0\n", - " MULTIPOLYGON (((30.2818 59.93306, 30.28272 59....\n", + " MULTIPOLYGON (((30.28180 59.93306, 30.28272 59...\n", " 3249\n", " Адмиралтейский округ\n", " [{'name_full': 'Численность населения', 'measu...\n", @@ -559,7 +559,7 @@ " \n", " \n", " 2\n", - " MULTIPOLYGON (((30.29074 59.90313, 30.2909 59....\n", + " MULTIPOLYGON (((30.29074 59.90313, 30.29090 59...\n", " 3251\n", " округ Измайловское\n", " [{'name_full': 'Численность населения', 'measu...\n", @@ -579,7 +579,7 @@ " \n", " \n", " 4\n", - " MULTIPOLYGON (((30.31777 59.9217, 30.31781 59....\n", + " MULTIPOLYGON (((30.31777 59.92170, 30.31781 59...\n", " 3250\n", " округ Семеновский\n", " [{'name_full': 'Численность населения', 'measu...\n", @@ -639,7 +639,7 @@ " \n", " \n", " 140\n", - " MULTIPOLYGON (((30.3592 59.94408, 30.3592 59.9...\n", + " MULTIPOLYGON (((30.35920 59.94408, 30.35920 59...\n", " 3170\n", " округ Смольнинское\n", " [{'name_full': 'Численность населения', 'measu...\n", @@ -654,17 +654,17 @@ ], "text/plain": [ " geometry territory_id \\\n", - "0 MULTIPOLYGON (((30.2818 59.93306, 30.28272 59.... 3249 \n", + "0 MULTIPOLYGON (((30.28180 59.93306, 30.28272 59... 3249 \n", "1 MULTIPOLYGON (((30.25023 59.90129, 30.25112 59... 3252 \n", - "2 MULTIPOLYGON (((30.29074 59.90313, 30.2909 59.... 3251 \n", + "2 MULTIPOLYGON (((30.29074 59.90313, 30.29090 59... 3251 \n", "3 MULTIPOLYGON (((30.26049 59.91726, 30.26152 59... 3253 \n", - "4 MULTIPOLYGON (((30.31777 59.9217, 30.31781 59.... 3250 \n", + "4 MULTIPOLYGON (((30.31777 59.92170, 30.31781 59... 3250 \n", ".. ... ... \n", "136 MULTIPOLYGON (((30.30827 59.94106, 30.30908 59... 3169 \n", "137 MULTIPOLYGON (((30.33489 59.95015, 30.33642 59... 3166 \n", "138 MULTIPOLYGON (((30.31013 59.93647, 30.31023 59... 3165 \n", "139 MULTIPOLYGON (((30.35063 59.91524, 30.35178 59... 3168 \n", - "140 MULTIPOLYGON (((30.3592 59.94408, 30.3592 59.9... 3170 \n", + "140 MULTIPOLYGON (((30.35920 59.94408, 30.35920 59... 3170 \n", "\n", " name indicators \\\n", "0 Адмиралтейский округ [{'name_full': 'Численность населения', 'measu... \n", @@ -763,21 +763,21 @@ " \n", " \n", " 0\n", - " POLYGON ((30.06574 59.6709, 30.07379 59.67194,...\n", + " POLYGON ((30.06574 59.67090, 30.07379 59.67194...\n", " 157558\n", " {}\n", " 2.0\n", " \n", " \n", " 1\n", - " POLYGON ((30.0877 60.08939, 30.09047 60.09382,...\n", + " POLYGON ((30.08770 60.08939, 30.09047 60.09382...\n", " 157559\n", " {}\n", " 1.0\n", " \n", " \n", " 2\n", - " POLYGON ((30.37948 59.7927, 30.38759 59.79372,...\n", + " POLYGON ((30.37948 59.79270, 30.38759 59.79372...\n", " 157560\n", " {}\n", " 3.0\n", @@ -791,7 +791,7 @@ " \n", " \n", " 4\n", - " POLYGON ((30.24918 60.02467, 30.25198 60.0291,...\n", + " POLYGON ((30.24918 60.02467, 30.25198 60.02910...\n", " 157562\n", " {}\n", " 3.0\n", @@ -826,7 +826,7 @@ " \n", " \n", " 2532\n", - " POLYGON ((30.74536 59.757, 30.74007 59.76043, ...\n", + " POLYGON ((30.74536 59.75700, 30.74007 59.76043...\n", " 160090\n", " {}\n", " 3.0\n", @@ -845,16 +845,16 @@ ], "text/plain": [ " geometry hexagon_id \\\n", - "0 POLYGON ((30.06574 59.6709, 30.07379 59.67194,... 157558 \n", - "1 POLYGON ((30.0877 60.08939, 30.09047 60.09382,... 157559 \n", - "2 POLYGON ((30.37948 59.7927, 30.38759 59.79372,... 157560 \n", + "0 POLYGON ((30.06574 59.67090, 30.07379 59.67194... 157558 \n", + "1 POLYGON ((30.08770 60.08939, 30.09047 60.09382... 157559 \n", + "2 POLYGON ((30.37948 59.79270, 30.38759 59.79372... 157560 \n", "3 POLYGON ((30.66727 59.76362, 30.66198 59.76704... 157561 \n", - "4 POLYGON ((30.24918 60.02467, 30.25198 60.0291,... 157562 \n", + "4 POLYGON ((30.24918 60.02467, 30.25198 60.02910... 157562 \n", "... ... ... \n", "2529 POLYGON ((30.45791 60.02272, 30.46608 60.02376... 160087 \n", "2530 POLYGON ((30.23231 59.84322, 30.23764 59.83983... 160088 \n", "2531 POLYGON ((29.50097 60.20315, 29.49286 60.20206... 160089 \n", - "2532 POLYGON ((30.74536 59.757, 30.74007 59.76043, ... 160090 \n", + "2532 POLYGON ((30.74536 59.75700, 30.74007 59.76043... 160090 \n", "2533 POLYGON ((30.17198 60.10435, 30.17477 60.10878... 160091 \n", "\n", " properties score \n", @@ -1106,166 +1106,9 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
projectaverage_population_densitytotal_populationscoreinterpretation
0None42.7586524.0Территория имеет хорошие показатели численност...
1None128.51766845.0Территория с высокими показателями численности...
2None120.51654705.0Территория с высокими показателями численности...
3None134.01840795.0Территория с высокими показателями численности...
4None81.61121765.0Территория с высокими показателями численности...
..................
2529None0.000.0Территория имеет нулевые показатели численност...
2530None0.000.0Территория имеет нулевые показатели численност...
2531None2.636232.0Территория имеет умеренные показатели численно...
2532None114.11567665.0Территория с высокими показателями численности...
2533None123.81701935.0Территория с высокими показателями численности...
\n", - "

2534 rows × 5 columns

\n", - "
" - ], - "text/plain": [ - " project average_population_density total_population score \\\n", - "0 None 42.7 58652 4.0 \n", - "1 None 128.5 176684 5.0 \n", - "2 None 120.5 165470 5.0 \n", - "3 None 134.0 184079 5.0 \n", - "4 None 81.6 112176 5.0 \n", - "... ... ... ... ... \n", - "2529 None 0.0 0 0.0 \n", - "2530 None 0.0 0 0.0 \n", - "2531 None 2.6 3623 2.0 \n", - "2532 None 114.1 156766 5.0 \n", - "2533 None 123.8 170193 5.0 \n", - "\n", - " interpretation \n", - "0 Территория имеет хорошие показатели численност... \n", - "1 Территория с высокими показателями численности... \n", - "2 Территория с высокими показателями численности... \n", - "3 Территория с высокими показателями численности... \n", - "4 Территория с высокими показателями численности... \n", - "... ... \n", - "2529 Территория имеет нулевые показатели численност... \n", - "2530 Территория имеет нулевые показатели численност... \n", - "2531 Территория имеет умеренные показатели численно... \n", - "2532 Территория с высокими показателями численности... \n", - "2533 Территория с высокими показателями численности... \n", - "\n", - "[2534 rows x 5 columns]" - ] - }, - "execution_count": 8, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "from popframe.method.territory_evaluation import TerritoryEvaluation\n", "\n", @@ -1278,7 +1121,7 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": null, "metadata": {}, "outputs": [ { @@ -1433,7 +1276,7 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": null, "metadata": {}, "outputs": [ { @@ -1482,7 +1325,7 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -1491,7 +1334,7 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": null, "metadata": {}, "outputs": [ { @@ -1675,7 +1518,7 @@ }, { "cell_type": "code", - "execution_count": 13, + "execution_count": null, "metadata": {}, "outputs": [ { @@ -1842,7 +1685,7 @@ }, { "cell_type": "code", - "execution_count": 14, + "execution_count": null, "metadata": {}, "outputs": [ { diff --git a/examples/engineer.ipynb b/examples/engineer.ipynb index 6784694..8f72a5f 100644 --- a/examples/engineer.ipynb +++ b/examples/engineer.ipynb @@ -1,8 +1,15 @@ { "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Инженерная инфраструктура\n" + ] + }, { "cell_type": "code", - "execution_count": 11, + "execution_count": null, "metadata": {}, "outputs": [ { @@ -148,7 +155,7 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": null, "metadata": {}, "outputs": [ { diff --git a/examples/landuse_assessment.ipynb b/examples/landuse_assessment.ipynb index 90eba5f..1e734c7 100644 --- a/examples/landuse_assessment.ipynb +++ b/examples/landuse_assessment.ipynb @@ -1,5 +1,12 @@ { "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Определение типов землепользования" + ] + }, { "cell_type": "code", "execution_count": 6, diff --git a/examples/spatial_inequality.ipynb b/examples/spatial_inequality.ipynb index 735a124..aa03c29 100644 --- a/examples/spatial_inequality.ipynb +++ b/examples/spatial_inequality.ipynb @@ -1,5 +1,13 @@ { "cells": [ + { + "cell_type": "markdown", + "id": "efd90e16", + "metadata": {}, + "source": [ + "# Пространственное неравенство" + ] + }, { "cell_type": "code", "execution_count": 2, @@ -26,7 +34,7 @@ "id": "532861f7", "metadata": {}, "source": [ - "# Подготовка данных" + "## Подготовка данных" ] }, { @@ -472,7 +480,7 @@ "id": "4a1a8caf", "metadata": {}, "source": [ - "# Тестовый пример" + "## Тестовый пример" ] }, { diff --git a/examples/territory_evaluation.ipynb b/examples/territory_evaluation.ipynb index 968f0d5..bf6afc6 100644 --- a/examples/territory_evaluation.ipynb +++ b/examples/territory_evaluation.ipynb @@ -1,5 +1,12 @@ { "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Оценка территории по критериям" + ] + }, { "cell_type": "code", "execution_count": 1, diff --git a/popframe/method/spatial_inequality.py b/popframe/method/spatial_inequality.py index 48a4366..34adc69 100644 --- a/popframe/method/spatial_inequality.py +++ b/popframe/method/spatial_inequality.py @@ -14,7 +14,7 @@ def transfer_inequality_metrics_to_polygons( self, gdf_cities: gpd.GeoDataFrame, gdf_polygons: gpd.GeoDataFrame, - inequality_keyword: str = "Неравенство" + inequality_keyword: str = "Нерaвенство" ) -> Tuple[gpd.GeoDataFrame, Dict[str, Dict[str, float]]]: """ Transfer all columns containing inequality metrics from points (cities) to polygons (agglomerations) @@ -27,7 +27,7 @@ def transfer_inequality_metrics_to_polygons( gdf_polygons : geopandas.GeoDataFrame GeoDataFrame with polygons (agglomerations). inequality_keyword : str, optional - Keyword to identify inequality metric columns. Default is "Неравенство". + Keyword to identify inequality metric columns. Default is "Нерaвенство". Returns ------- diff --git a/popframe/utils/__init__.py b/popframe/utils/__init__.py index 7541c46..55c56d2 100644 --- a/popframe/utils/__init__.py +++ b/popframe/utils/__init__.py @@ -2,4 +2,3 @@ Some utilies used in popframe are located here. """ from .const import * -from .service_types import SERVICE_TYPES