0

I am generating documentation for a project using Read the Docs. The build runs successfully but the documentation shows only for one module but not the other, even though I used the same syntax.

Below is a reduced version of the module for which the documentation succeeds to appear

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Project  Module 

This module helps debug the documentation issue with readthedocs
"""


__version__ = "1.1.0"


class Module:
    """
    This is the name of the class
    
    Parameters
    ----------
    param1 : float
        param1 is a float
    param2 : list, optional, default [0,1,2]
        description of param2
        
        description of param2 
        
        description of param2 
    Returns
    -------
    Class 
    """
    
    def __init__(self, param1, param2=[0, 1, 2]):
        self.param1 = param1
        self.param2 = param2 

class subclass(Module):
    """
    A subclass that inherits from the class Module

    Parameters
    ----------
    param1 : float
        param1 is a float
    param2 : list, optional, default [0,1,2]
        description of param2 
        
        description of param2 
        
        description of param2 
    Returns
    -------
    subClass  

    """
    
    def __init__(self, param1, param2=[0, 1, 2]):
        Module.__init__(self, param1, param2=param2)
        self.param1 = param1
        self.param2 = param2 

    def func1(self):
        """
        A function that has no arguments, return nothing, but may change the state variables of the subclass
        """
        pass
       
        
    def update_control_t(self, arg1, arg2):
        """
        func with arguments

        Parameters
        ----------
        arg1 : float
            input1 from user 
        arg2 : int
            input2 from user 
        """

        return arg1+arg2

and the reduced version of the module for which the documentation does not appear:

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
A brief summary of the module

Long description goes here
"""

__version__ = "1.1.0"


# import modules
import numpy as np

class Asset:
    """
    This is the name of the class
    
    Parameters
    ----------
    param1 : float
        param1 is a float
    param2 : list, optional, default [0,1,2]
        description of param2
        
        description of param2 
        
        description of param2 
    Returns
    -------
    Class 
    """
    
    def __init__(self):

here is a link of the generated documentation: https://project-rtd.readthedocs.io/en/latest/api_reference.html

an here https://github.com/chaimaa-ess/project is the link of a 'minimal' version of the repository that reproduces the issue.

I'm expecting to see documentation for both modules

Chaimaa
  • 1
  • 3
  • In Asset.py, you have `import numpy as np`. Is NumPy installed (or mocked)? See https://stackoverflow.com/a/67486947/407651 – mzjn Aug 04 '23 at 15:35
  • Thank you! I needed to add a requirements.txt containing all the imports under the docs (or docs/src) folder. – Chaimaa Aug 11 '23 at 11:50

0 Answers0