Skip to content

Commit

Permalink
Merge pull request #37 from sdss/albireox/configsubmodule
Browse files Browse the repository at this point in the history
Add new configsubmodule function
  • Loading branch information
albireox authored May 8, 2023
2 parents 2d099ea + a705d83 commit 3086b05
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
6 changes: 5 additions & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ Change Log

This document records the main changes to the sdss_access code.

Next release
------------

- Adds new `configsubmodule` special function.

2.0.5 (2022-11-30)
------------------
- Bug fix for downloading IPL-1 products with sdss_access
Expand Down Expand Up @@ -179,4 +184,3 @@ Added
Changed
^^^^^^^
* Migrated sdss_access over into the cookiecutter model

22 changes: 22 additions & 0 deletions python/sdss_access/path/path.py
Original file line number Diff line number Diff line change
Expand Up @@ -1362,6 +1362,28 @@ def configgrp(self, filetype, **kwargs):
return '0000XX'
return '{:0>4d}XX'.format(int(configid) // 100)

def configsubmodule(self, filetype, **kwargs):
''' Returns configuration summary submodule group subdirectory
Parameters
----------
filetype : str
File type parameter.
configid : int or str
Configuration ID number. Will be converted to int internally.
Returns
-------
configsubmodule : str
Configuration submodule directory in the format ``NNNXXX``.
'''

configid = kwargs.get('configid', None)
if not configid:
return '000XXX'
return '{:0>3d}XXX'.format(int(configid) // 1000)

def isplate(self, filetype, **kwargs):
''' Returns the plate flag for BOSS idlspec2d run2d versions that utilize it
Expand Down

0 comments on commit 3086b05

Please sign in to comment.