IN-CORE / pyincore

pyIncore is a component of IN-CORE. It is a python package consisting of two primary components: 1) a set of service classes to interact with the IN-CORE web services, and 2) IN-CORE analyses . The pyIncore allows users to apply various hazards to infrastructure in selected areas, propagating the effect of physical infrastructure damage and loss of functionality to social and economic impacts.
Mozilla Public License 2.0
25 stars 7 forks source link

need to preserve original functions docstring #593

Closed longshuicy closed 1 month ago

longshuicy commented 3 months ago

Some of the method wrapped with custom decorators didn't build successfully with sphinx autodoc. Now add code to fix that.


To test:

ylyangtw commented 1 month ago

Not sure whether it's my local but I am getting errors for this command docker build -f Dockerfile -t doc/pyincore:customdecorator . Here is the output:

 => ERROR [builder 4/7] RUN micromamba install -y -n base -c conda-forge     beautifulsoup4     sphinx sphinx_rtd_theme     -f requirements.txt                                                                                   15.5s
------
 > [builder 4/7] RUN micromamba install -y -n base -c conda-forge     beautifulsoup4     sphinx sphinx_rtd_theme     -f requirements.txt:
#0 15.41 error    libmamba Could not solve for environment specs
#0 15.41     The following package could not be installed
#0 15.41     └─ pyomo >=6.0.0,<=6.6.2  does not exist (perhaps a typo or a missing channel).
#0 15.45 critical libmamba Could not solve for environment specs
------
Dockerfile:13
--------------------
  12 |     ENV PATH "$MAMBA_ROOT_PREFIX/bin:$PATH"
  13 | >>> RUN micromamba install -y -n base -c conda-forge \
  14 | >>>     beautifulsoup4 \
  15 | >>>     sphinx sphinx_rtd_theme \
  16 | >>>     -f requirements.txt
  17 |     
--------------------
ERROR: failed to solve: process "/usr/local/bin/_dockerfile_shell.sh micromamba install -y -n base -c conda-forge     beautifulsoup4     sphinx sphinx_rtd_theme     -f requirements.txt" did not complete successfully: exit code: 1
navarroc commented 1 month ago

Not sure whether it's my local but I am getting errors for this command docker build -f Dockerfile -t doc/pyincore:customdecorator . Here is the output:

 => ERROR [builder 4/7] RUN micromamba install -y -n base -c conda-forge     beautifulsoup4     sphinx sphinx_rtd_theme     -f requirements.txt                                                                                   15.5s
------
 > [builder 4/7] RUN micromamba install -y -n base -c conda-forge     beautifulsoup4     sphinx sphinx_rtd_theme     -f requirements.txt:
#0 15.41 error    libmamba Could not solve for environment specs
#0 15.41     The following package could not be installed
#0 15.41     └─ pyomo >=6.0.0,<=6.6.2  does not exist (perhaps a typo or a missing channel).
#0 15.45 critical libmamba Could not solve for environment specs
------
Dockerfile:13
--------------------
  12 |     ENV PATH "$MAMBA_ROOT_PREFIX/bin:$PATH"
  13 | >>> RUN micromamba install -y -n base -c conda-forge \
  14 | >>>     beautifulsoup4 \
  15 | >>>     sphinx sphinx_rtd_theme \
  16 | >>>     -f requirements.txt
  17 |     
--------------------
ERROR: failed to solve: process "/usr/local/bin/_dockerfile_shell.sh micromamba install -y -n base -c conda-forge     beautifulsoup4     sphinx sphinx_rtd_theme     -f requirements.txt" did not complete successfully: exit code: 1

my micromamba version 1.5.8

hmmm...it builds ok on my system. I just tested it again on mine. Your micromamba version shouldn't matter since this is building in docker not using your system settings.

ylyangtw commented 1 month ago

Not sure whether it's my local but I am getting errors for this command docker build -f Dockerfile -t doc/pyincore:customdecorator . Here is the output:

 => ERROR [builder 4/7] RUN micromamba install -y -n base -c conda-forge     beautifulsoup4     sphinx sphinx_rtd_theme     -f requirements.txt                                                                                   15.5s
------
 > [builder 4/7] RUN micromamba install -y -n base -c conda-forge     beautifulsoup4     sphinx sphinx_rtd_theme     -f requirements.txt:
#0 15.41 error    libmamba Could not solve for environment specs
#0 15.41     The following package could not be installed
#0 15.41     └─ pyomo >=6.0.0,<=6.6.2  does not exist (perhaps a typo or a missing channel).
#0 15.45 critical libmamba Could not solve for environment specs
------
Dockerfile:13
--------------------
  12 |     ENV PATH "$MAMBA_ROOT_PREFIX/bin:$PATH"
  13 | >>> RUN micromamba install -y -n base -c conda-forge \
  14 | >>>     beautifulsoup4 \
  15 | >>>     sphinx sphinx_rtd_theme \
  16 | >>>     -f requirements.txt
  17 |     
--------------------
ERROR: failed to solve: process "/usr/local/bin/_dockerfile_shell.sh micromamba install -y -n base -c conda-forge     beautifulsoup4     sphinx sphinx_rtd_theme     -f requirements.txt" did not complete successfully: exit code: 1

my micromamba version 1.5.8

hmmm...it builds ok on my system. I just tested it again on mine. Your micromamba version shouldn't matter since this is building in docker not using your system settings.

No worries I got it run by adding --platform linux/amd64 to the command. Will continue the testing