Skip to content

Commit

Permalink
clean up doc and get toc to build right again; sphinx 5.3
Browse files Browse the repository at this point in the history
  • Loading branch information
tomweber-sas committed Sep 11, 2024
1 parent 7e218e4 commit 1c4021c
Show file tree
Hide file tree
Showing 10 changed files with 155 additions and 170 deletions.
8 changes: 4 additions & 4 deletions saspy/doc/source/adding-procedures.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
.. Copyright SAS Institute
************************
========================
Contributing new methods
************************
========================

Overview
--------
========
This module is broken into product areas that largely follow the SAS product areas.
There are many many procedures, which translate to object methods, that are not
currently included in the package. The aim of this document is to outline the
Expand All @@ -21,7 +21,7 @@ minutes for subsequent methods.
Your contribution and feedback is greatly appreciated!

Process
=======
~~~~~~~

To add a new procedure follow these steps:

Expand Down
46 changes: 16 additions & 30 deletions saspy/doc/source/advanced-topics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@ Advanced topics
In this chapter we will explore more detailed explanations of specific functionality.


****************
Using Batch mode
****************
================

Batch mode is meant to be used when you want to automate your code as Python scripts.

Expand Down Expand Up @@ -64,9 +63,8 @@ than this few lines of code, you can have the results updated and refreshed by j
re-running the script.


*********
Prompting
*********
=========

There are two types of prompting that can be performed; meaning to stop processing and
prompt the user for input and then resume processing.
Expand Down Expand Up @@ -188,9 +186,8 @@ at runtime for values you want to use in the code, and those values can be
kept around and used later in the code, or hidden and inaccessible afterward.


***************************************************************
Moving values between Python Variables and SAS Macro Variables
***************************************************************
==============================================================

There are two methods on the SASsession object you can use to transfer values between Python and SAS.
symget() and symput(). To get a value from a SAS Macro Variable and assign it to a Python variable you
Expand All @@ -213,9 +210,8 @@ https://github.com/sassoftware/saspy-examples/blob/main/SAS_contrib/Using_SYMGET



********************************************************
Moving data between Python and SAS - datatype conversion
********************************************************
========================================================

SASPy has methods to load data from a SAS Data Set (or View) into Python as a Pandas dataframe, as well
as the reverse; loading a dataframe into a SAS Data Set. This is all documented in the API doc and some
Expand Down Expand Up @@ -265,9 +261,8 @@ become missing values in SAS.
**********************************
Dates, Times and Datetimes, Oh my!
**********************************
==================================

The sd2df and df2sd methods transfer data between SAS Data Sets and Pandas dataframes. For most
cases, if you start with a SAS dataset and import it to a dataframe, then send it back to SAS,
Expand Down Expand Up @@ -362,9 +357,8 @@ https://github.com/sassoftware/saspy-examples/blob/main/Issue_examples/Issue279.



***********************************
Advanced sd2df and df2sd techniques
***********************************
===================================

The sd2df and df2sd methods transfer data between SAS Data Sets and Pandas dataframes. For most cases,
you don't need to specify extra options. But, there are extra options to cover a variety of specific
Expand Down Expand Up @@ -492,9 +486,8 @@ https://github.com/sassoftware/saspy/issues/279 to see where this fuctionality c



******************************************************************************
Slow performance loading SAS data into a Pandas DataFrame ( to_df(), sd2df() )
******************************************************************************
==============================================================================

UPDATE!!!

Expand Down Expand Up @@ -538,9 +531,8 @@ and newlines, which Pandas can have parsing problem with reading CSV file create



*****************************************************************
Slow performance loading a DataFrame into a SAS data set; df2sd()
*****************************************************************
=================================================================

df2sd (dataframe2sasdata) has two main steps, which were both done internal to the method. The second is transferring the data
but the first is figureing out the necessary metadata to be able to correctly define the SAS Data Set being created. This requires
Expand Down Expand Up @@ -686,9 +678,8 @@ Here are a few example cases showing this.
*****************************************************************************
Using Proc Iomoperate to find Object Spawner hosts and Workspace Server ports
*****************************************************************************
=============================================================================

If you already use a client to connect to IOM servers, you may have the host and port to OMR
(the SAS Metadata Server), but not necessarily those of the Object Spawners or Workspace Servers.
Expand Down Expand Up @@ -782,9 +773,8 @@ convention for these is to use the 'Server context :' value as the config name.
to know which server you will be connecting to.


**************************************************************
Disconnecting from an IOM session and reconnecting back to it.
**************************************************************
==============================================================

The IOM access method has the ability to disconnect from the workspace server and
reconnect to it (the same one); IF the reconnect setting is configured for that workspace
Expand Down Expand Up @@ -818,9 +808,8 @@ a single process, and each time a disconnect happens a new toke is created. But,
specific case, so it is now available.


*******************************************************************
Configuring Grid Option Sets to have saspy run on a specific Queue.
*******************************************************************
===================================================================

Working with Grid Options Sets is documented here (the 'Doc' referred to below):
http://support.sas.com/documentation/cdl/en/gridref/67371/HTML/default/viewer.htm#n1inymfs0b7go2n147xdknz0ygpx.htm
Expand All @@ -847,9 +836,8 @@ in to the grid options mapping wizard (the first part of the document referenced
should now be available to choose and you can set this up as you want.


****************************************************************
Automatic checking for ERROR: in the LOG and the warnings module
****************************************************************
================================================================

Based upon an enhancement request, as of version 3.6.7, SASPy now checks for 'ERROR:' and issues a message via the warnings module
to inform you that you should take a look at the log and see if there was a problem. SASPy methods won't blindly fail just by finding
Expand Down Expand Up @@ -964,9 +952,8 @@ Hopefully you will find this enhancement useful. It would be great if each thing
not the case. So, checking the log is something that's necessary sometimes. Hopefully this warning when an ERROR is seen, will make this easier.


*********************************************
saspy.logger from logging.logger as of V3.7.5
*********************************************
=============================================

Per a user request to get rid of using print() for variaous messages, and use the logging facility instead, I've
replaced all non-interactive prints() in saspy (print is still used for prompting, as it needs to be) with
Expand Down Expand Up @@ -1100,9 +1087,8 @@ Here's just a little example of a programm showing some of this.
***************************************************
SASsession object as a context manager as of V3.7.5
***************************************************
===================================================

A user contributed, via PR #401, the ability for a SASsession object to be used as a context manage
for the 'with' statement (see https://docs.python.org/3.9/reference/datamodel.html#context-managers).
Expand Down Expand Up @@ -1177,9 +1163,9 @@ Here's a live example showing that the Session was terminated after the with con
>>>
**************
Jupyter magics
**************
==============

Jupyter Notebooks have what they call Magics, which let you submit code from a diferent language
than the kernel of the notebook, or provide other functionality. SASPy supports a few magics that
you can use if you are in a Jupyter Notebook. They simply allow you to submit explicit SAS code
Expand Down
22 changes: 9 additions & 13 deletions saspy/doc/source/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
.. Copyright SAS Institute
*************
=============
API Reference
*************
=============

.. automodule:: saspy
:members:
Expand All @@ -13,30 +13,27 @@ API Reference
:show-inheritance:

SAS Session Object
------------------
.. autoclass:: SASsession
==================
.. autoclass:: saspy.sasbase.SASsession
:members:

SAS Data Object
---------------

===============
.. autoclass:: saspy.sasdata.SASdata
:members:

Procedure Syntax Statements
---------------------------

===========================
.. autoclass:: saspy.sasproccommons.SASProcCommons
:members:


SAS Results
-----------
===========
.. autoclass:: saspy.sasresults.SASresults
:members:

SAS Procedures
--------------
==============

Utility
~~~~~~~
Expand All @@ -51,7 +48,6 @@ Machine Learning (SAS Enterprise Miner)
.. autoclass:: saspy.sasml.SASml
:members:

.. autosummary:: saspy.sasml.SASml

Statistics
~~~~~~~~~~
Expand Down Expand Up @@ -80,7 +76,7 @@ SAS Viya VDMML


SASPy Scripts
-------------
=============

run_sas.py
~~~~~~~~~~
Expand Down
19 changes: 13 additions & 6 deletions saspy/doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,13 @@
autodoc_default_flags = ['show-inheritance']
autoclass_content = 'class'

intersphinx_mapping = {'python': ('https://docs.python.org/', None),
'pandas': ('http://pandas.pydata.org/pandas-docs/stable/', None),
'numpy': ('http://docs.scipy.org/doc/numpy/', None),
'scipy': ('http://docs.scipy.org/doc/scipy/reference/', None),
'matplotlib': ('http://matplotlib.sourceforge.net/', None)}
intersphinx_mapping = {'python': ('https://docs.python.org/3', None),
'pandas': ('https://pandas.pydata.org/pandas-docs/stable/', None),
'numpy': ('https://docs.scipy.org/doc/numpy/', None),
'scipy': ('https://docs.scipy.org/doc/scipy/reference/', None),
# 'matplotlib': ('https://matplotlib.sourceforge.net/', None)
}


# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
Expand Down Expand Up @@ -151,7 +153,12 @@
html_theme_options = {
# Toc options
'collapse_navigation': False,
'sticky_navigation': True,
'navigation_depth': 5,
'includehidden': True,
'titles_only': False,
'globaltoc_maxdepth' : 5,

}


Expand Down Expand Up @@ -327,4 +334,4 @@


# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {'https://docs.python.org/': None}
#intersphinx_mapping = {'https://docs.python.org/3': None}
4 changes: 2 additions & 2 deletions saspy/doc/source/configuration.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

===============
=============
Configuration
===============
=============

This module can connect and start different kinds of SAS sessions. It can connect to SAS
on Unix, Mainframe, and Windows. It can connect to a local SAS session or remote session.
Expand Down
Loading

0 comments on commit 1c4021c

Please sign in to comment.