GithubHelp home page GithubHelp logo

cgq-qgc / pyhelp Goto Github PK

View Code? Open in Web Editor NEW
17.0 17.0 4.0 21.94 MB

A Python library for the assessment of spatially distributed groundwater recharge and hydrological components with HELP

License: MIT License

Python 17.94% Fortran 82.06%
groundwater-recharge help-model modelling python

pyhelp's People

Contributors

jnsebgosselin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

pyhelp's Issues

Add support for Python 3.7 in Windows.

This will allow to simplify the installation instruction.

We want to be able to support Python 3.6 and 3.7. This should be very simple to do and will only consist in adding it to the matrix in AppVeyor.

forrtl: error (200) when closing the windows console

>>> forrtl: error (200): program aborting due to window-CLOSE event
Image              PC                Routine            Line        Source
libifcoremd.dll    00007FFCD18A94C4  Unknown               Unknown  Unknown
KERNELBASE.dll     00007FFD278556FD  Unknown               Unknown  Unknown
KERNEL32.DLL       00007FFD2AA83034  Unknown               Unknown  Unknown
ntdll.dll          00007FFD2B1A1471  Unknown               Unknown  Unknown
QObject::~QObject: Timers cannot be stopped from another thread

https://software.intel.com/pt-br/node/738412
https://www.codeproject.com/Questions/767327/forrtl-error-program-aborting-due-to-window-CLOSE
https://stackoverflow.com/questions/42653389/ctrl-c-causes-forrtl-error-200-rather-than-python-keyboardinterrupt-exception

Use the m2w64-toolchain from Anaconda to build the HELP3O extension

I think that using the m2w64-toolchain directly from Anaconda will make my life easier in the long run if this works instead of installing mingw-w64 separately from:

https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/mingw-builds/#installer/mingw-w64-install.exe/download

However, this is not easy. An early attempt failed when trying to do it in PR #25, though everything was working fine locally. So I do not know what is going on.

Resources:
https://www.msys2.org/
ContinuumIO/anaconda-issues#1484

Petite erreur dans exemple pyhelp

@FHuchet @mraynauld

J'ai trouvé une petite erreur dans le script exemple de pyhelp version 0.3.0 (ou moins) pour le calcul des cellules de type "eau de surface".

Lorsque l'on lance les calculs HELP pour un sous-bassin X, il est important de passer la liste des cellules de la grille associées à ce sous-bassin à la fonction pour calculer avec HELP, mais aussi aux cellules pour calculer les cellules eau.

Dans le fichier exemple de pyhelp version 0.3.0 et moins, la liste des cellules n'est pas passée à la fonction helpm.calc_surf_water_cells, ce qui veut dire que les calculs sont faits pour toutes les cellules eau de la zone d'étude au complet, ce qui va biaisé les débits totaux et de base obtenus pour le sous-bassin, car la proportion de cellules eau sera alors surestimée.

J'ai corrigé le tout dans l'exemple 0.3.1. Je suis vraiment désolé si cela vous cause des soucis.

C'est-à-dire:

image

Remove the needs for the "year_range" argument in HelpManager

With the changes made in PR #12, having the requirement to specified a year_range value when instantiating HelpManager is useless and annoying. The year range info should be provided when actually running the simulation, not before.

This needs to be removed.

Define SUBROUTINE and FUNCTION argument typespec explicitely in HELP

As mentionned in #22 (comment), arguments of each SUBROUTINE or FUNCTION should be explicitly defined. This is to avoid warning or the type vars2fortran: No typespec for argument "nt". Block: leap when compiling with f2py.

For example, the SUBROUTINE READIN does not produce such a warnings.

C      ************************* READIN *************************
C
C  SUBROUTINE READIN READS ET AND SOIL DESIGN DATA, AND WEATHER HEADERS
C
      SUBROUTINE READIN (fpath_precip, fpath_tasavg, fpath_solrad,
     1 fpath_evapo, fpath_soil)
      
      CHARACTER(len=260), INTENT(IN) :: fpath_precip
      CHARACTER(len=260), INTENT(IN) :: fpath_tasavg
      CHARACTER(len=260), INTENT(IN) :: fpath_solrad
      CHARACTER(len=260), INTENT(IN) :: fpath_evapo
      CHARACTER(len=260), INTENT(IN) :: fpath_soil

So I think this can be safely ignored for the moment.

The PyHelp input format should be more general

Currently, PyHelp is limited to using data from specific sources. Even worse, the meteo grid from info-climat is not even available publicly.

We need to change that so data from any source can be used.

Problème données météo (format et aucun enregistrement dans le fichier output)

Il y a un problème avec les nouvelles données météo pour Mercier (sans doute relié à une histoire de format pour l'affichage des graphes) :
image

De même, j'ai regardé le fichier de résultats "help_example_yearly.csv" et rien n'a été calculé (à part le runoff) :
image

Auparavant, j'avais testé le fichier exemple par défaut et il fonctionne bien. Ensuite, j'avais ajouté mon fichier input pour Mercier et le fichier des données de débit et tout fonctionnait. Le problème vient donc des données météo.

Tiens moi au courant, :)

Leap year issue for climate scenario

Bonjour Jean-Sébastien,

Un petit souci est apparu quand j'ai voulu lancer ma première simulation climatique avec les données futures :

image

Je pense que c'est lors de la vérification des années bissextiles dans le script (managers.py) :

image

Je préfère t'envoyer une "issue" que de modifier le script moi-même...

Merci pour ton retour,
Bonne journée.

AssertionError (lorsque les données climatiques en entrée n'ont pas d'année bissextile)

Problème avec les fichiers météo lors de la production du fichier D4.
image

Est-ce lié au fait que les dates ne sont pas formater comme avec les fichiers historiques ?
image

Historique : jour/mois/année
Futur : année-mois-jour

J'ai fait un test en ne mettant que l'année 2006 au format futur (année-mois-jour) et la simulation a fonctionné. Donc le problème réside sans doute encore dans les longueurs des années je pense.

Je vais t'envoyer le dossier par courriel avec mes données d'entrée pour la simulation A10 pour que tu puisses faire des tests sur la période 2006-2095.

Merci encore pour ton aide précieuse.

Complete documentation

This Epic is to follow the tasks that need to be done in order to complete the documentation for the first official release of PyHelp.

  • About
  • Weather input data format
  • Geomatics input data format
  • Basic Example
  • Installation
  • How to contribute
  • Complete Example
  • Workflow
  • Calibration
  • Outputs
  • References (PR #20)

TypeError when creating area monthly plot

Running one of the following commands results in an error:

  • plot_area_monthly_avg()
  • output.plot_area_yearly_avg()
  • output.plot_area_yearly_series()
Traceback (most recent call last):
  File "C:\Users\User\pyhelp\example\help_example.py", line 43, in <module>
    output.plot_area_monthly_avg()
  File "C:\Users\User\pyhelp\pyhelp\output.py", line 195, in plot_area_monthly_avg
    fsize=(9, 6.5), margins=(1.5, 1, 0.25, 0.7))
TypeError: _create_figure() got multiple values for argument 'fsize'

Split "Install from source" documentation section

The idea would be to split the current section named Install PyHELP from source in two and have a section named Install PyHELP from source and another section named Contribute to PyHELP.

In the Install PyHELP from source section we would not talk about git at all. We will also link to an official release of PyHELP to download the source code.

In the Contribute to PyHELP we will give instruction to run PyHELP from the development version using git. We also need to add instruction to be able to build the documentation. Also, we need to add instruction to install the required dependencies for the tests.

"Target environment permission" et modif' des attributs des graphes

Bonjour Jean-Sébastien,

En essayant de modifier les axes de mes graphes (via la commande CTRL + G), je me suis rendu compte que je ne pouvais pas le faire. En fait, je ne peux pas modifier le code sur le PC de modélisation de l'INRS (je voulais mettre 1974 à la place de 1980 pour les années - axe des X).
image

J'ai donc relancé Anaconda et lors de l'update, l'accès vers le dossier semble refusé (pas la permission requise).
image

Penses-tu que le fait de ne pas pouvoir modifier les attributs des graphes (tailles des polices, longueur des axes... etc) est lié à ce problème d'accès ?

J'ai en fait ouvert Spyder sur mon PC personnel et je peux faire la modification (j'ai pu modifier les années).
image

Merci pour ta réponse,
Bonne journée.

Bug lors de la sauvegarde des outputs

HELP simulation in progress: 100.0% (0.0 min remaining)      
Task completed in 145.64 sec
Post-processing cell 22202 of 22202... done
Saving data to help_example.out...
Traceback (most recent call last):

  Input In [54] in <cell line: 1>
    output = helpm.calc_help_cells(help_output_hdf5, tfsoil=-3)

  File ~\.conda\envs\PyHELP\lib\site-packages\pyhelp\managers.py:316 in calc_help_cells
    help_output.save_to_hdf5(path_to_hdf5)

  File ~\.conda\envs\PyHELP\lib\site-packages\pyhelp\output.py:102 in save_to_hdf5
    group.attrs['index'] = list(self.grid.index)

  File h5py\_objects.pyx:54 in h5py._objects.with_phil.wrapper

  File h5py\_objects.pyx:55 in h5py._objects.with_phil.wrapper

  File ~\.conda\envs\PyHELP\lib\site-packages\h5py\_hl\attrs.py:103 in __setitem__
    self.create(name, data=value)

  File ~\.conda\envs\PyHELP\lib\site-packages\h5py\_hl\attrs.py:196 in create
    attr = h5a.create(self._id, self._e(tempname), htype, space)

  File h5py\_objects.pyx:54 in h5py._objects.with_phil.wrapper

  File h5py\_objects.pyx:55 in h5py._objects.with_phil.wrapper

  File h5py\h5a.pyx:50 in h5py.h5a.create

RuntimeError: Unable to create attribute (object header message is too large)

The water budget for cells located in surface water bodies need to be calculated on a monthly basis.

Currently, for cells located in surface water bodies, we calculate the water budget on a yearly basis only.

Basically, we take a constant value for the yearly evaporation from a map* and subtract this constant value to the annual precipitation. The results is stored as surface runoff.

There is no reason not to use our input data to actually calculate monthly values for each cell located in surface water bodies, except the lack of time to do it...

ValueError: could not convert string to float

J'arrive à lancer la simulation HELP pour certains bassins. Par contre, il y en a pour lesquels j'ai cette erreur lorsque je lance la simulation HELP. Est-ce que c'est un problème qui provient du fichier input?

The above exception was the direct cause of the following exception:

Traceback (most recent call last):

  File "D:\OneDrive\INRS\2021 - PACES Estrie\help_example.py", line 43, in <module>
    output_help = helpm.calc_help_cells(

  File "D:\Projets\pyhelp\pyhelp\managers.py", line 375, in calc_help_cells
    output_data = run_help_allcells(cellparams)

  File "D:\Projets\pyhelp\pyhelp\processing.py", line 52, in run_help_allcells
    for cell in pool.imap_unordered(run_help_singlecell, cellparams.items()):

  File "C:\Python38\lib\multiprocessing\pool.py", line 868, in next
    raise value

ValueError: could not convert string to float: '*******'

image

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.