Giter Club home page Giter Club logo

hydrus's Introduction

hydrus

水文水资源(Hydrology and Water Resources)研究和应用中使用Python的基础教程

主要内容

本repo不是一个一步步照做的教程,而是基于个人学习记录改编的笔记,作用是为像我一样非计算机相关专业,不需要从头到尾完全系统学习的同学提供参考,串联某些基本概念。本repo目前仍在编辑中,一直会有更新,内容常会做写调整;且可能仍有一些不通畅之处,遇错见谅。

主要涉及的内容(持续更新中)有:

  1. Python基础
  2. 常用科学计算库
  3. 可视化

运行本repo步骤

下载本repo,需要本地预先下载安装好git,如果没有安装那么在此处下载,并点击下载好的安装包安装,安装过程中全部选择默认配置即可。

本项目在Windowsn和Linux系统下均可运行,启动前,先在conda的base环境下启动jupyter lab。如果没有jupyterlab就执行下面语句。

如果第一步就报错,说明你还没有安装conda,需要先参考 https://zhuanlan.zhihu.com/p/102564715 安装miniconda并配置好环境变量,再执行下面语句

# 激活conda的base环境
conda activate
# 安装jupyterlab(如果base下没有jupyterlab的话)
conda install jupyterlab

之后再运行下面的语句。

如果已经有了jupyterlab,就从这里开始:

# fork为自己的repo后,从自己的github处下载本项目
git clone "你的hydrus github仓库的ssh地址"
# 进入本项目根目录
cd hydrus
# 创建hydrus环境
conda create -n hydrus python=3.9
# 激活hydrus环境
conda activate hydrus
# conda安装太慢,因此这里使用mamba安装各种包
conda install mamba -c conda-forge
# 然后使用mamba安装运行代码所需的包
mamba install -c conda-forge ipykernel numpy pandas openpyxl feather-format scipy matplotlib xarray netCDF4 dask seaborn cartopy geopandas geoplot plotly

接下来就可以运行本repo中的程序啦:

# 将hydrus环境添加到jupyterlab Launcher显示的kernel
python -m ipykernel install --user --name hydrus --display-name "hydrus"
# 如果你本来就是在jupyterlab下的terminal中执行就不必再启动jupyterlab了,否则就执行下面语句打开jupyterlab
jupyter lab

然后打开任意一个.ipynb文件,如果弹出提示“Select Kernel”,请选择hydrus,接着就可以运行打开的文件了。

可以从这里开始:1-basic-envir,如果不熟悉刚刚提到的git和jupyter lab,1-basic-envir/1-get-started.md里也有介绍。

注意如果之前已经fork过本repo了,现在本repo已经更新,而自己那边还没有过同步,那么版本就会落后于本repo,所以需要注意和上游保持一致,同步方法请参考这里

注意,本repo中可视化部分有涉及关于GIS方面内容,若对水文中gis的简单学习使用有兴趣,可以关注:hydroGIS

最后推荐一些学科科研相关的python学习资料:

更多内容可以关注:awesome-python

参与贡献

  1. Fork 本项目
  2. 新建 xxx 分支
  3. 提交代码
  4. 新建 Pull Request

hydrus's People

Contributors

ouyangwenyu avatar wangmengyun1998 avatar dependabot[bot] avatar newhuacn123 avatar newhuacn avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.