Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change project src folder layout to use subfolder 'ale' #533

Merged
merged 6 commits into from
Sep 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ jobs:
needs: [build-wheels, build-scratch]

strategy:
fail-fast: false
matrix:
include:
# example wheel names (if the wheel names change, look at the `ls wheels/` for the new names)
Expand Down
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
## ALE
ale
build
doc/examples/*Example


# Don't save roms in repo
*.tar.gz.b64
*.tar.gz
Expand Down Expand Up @@ -164,3 +164,7 @@ cython_debug/

# Docs
/docs/_build/

# CLion project settings and build-folders
cmake-build-*
.idea
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ project(ale VERSION ${ALE_DEFAULT_VERSION}
LANGUAGES CXX)

# Main ALE src directory
add_subdirectory(src)
add_subdirectory(src/ale)

# Only include tests in the main project
if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ classifiers = [
"Topic :: Scientific/Engineering :: Artificial Intelligence",
]
dependencies = [
"numpy",
"numpy<2.0",
"importlib-metadata>=4.10.0; python_version < '3.10'",
"importlib-resources; python_version < '3.9'",
"typing-extensions; python_version < '3.11'"
Expand All @@ -60,7 +60,7 @@ packages = [
"ale_py",
"ale_py.roms",
]
package-dir = {ale_py = "src/python"}
package-dir = {ale_py = "src/ale/python"}
package-data = {"ale_py" = ["py.typed", "*.pyi", "**/*.pyi"], "ale_py.roms" = ["md5.json", "*.bin"]}

[tool.pytest.ini_options]
Expand Down
2 changes: 1 addition & 1 deletion scripts/download_unpack_roms.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# define some directories
base_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" &> /dev/null && pwd)/.."
unpack_dir="${base_dir}/unpack_dir"
target_dir="${base_dir}/src/python/roms"
target_dir="${base_dir}/src/ale/python/roms"

# make the directory where we will do the unpacking
mkdir $unpack_dir
Expand Down
4 changes: 2 additions & 2 deletions src/CMakeLists.txt → src/ale/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Include src/ and cmake binary directory (for version.hpp)
include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
include_directories(BEFORE ${PROJECT_SOURCE_DIR}/src ${CMAKE_CURRENT_BINARY_DIR})

# Project specific target properties
set(CMAKE_CXX_STANDARD 17)
Expand Down Expand Up @@ -102,7 +102,7 @@ if (UNIX AND BUILD_CPP_LIB)

# Configure installable cmake config
configure_package_config_file(
${CMAKE_CURRENT_SOURCE_DIR}/../cmake/${PROJECT_NAME}-config.cmake.in
${PROJECT_SOURCE_DIR}/cmake/${PROJECT_NAME}-config.cmake.in
${PROJECT_NAME}-config.cmake
INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME})

Expand Down
16 changes: 8 additions & 8 deletions src/ale_interface.cpp → src/ale/ale_interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
* The shared library interface.
**************************************************************************** */

#include "ale_interface.hpp"
#include "ale/ale_interface.hpp"

#include <algorithm>
#include <cassert>
Expand All @@ -44,13 +44,13 @@
#include <filesystem>
#include <fstream>

#include "common/ColourPalette.hpp"
#include "common/Constants.h"
#include "emucore/Console.hxx"
#include "emucore/Props.hxx"
#include "emucore/MD5.hxx"
#include "environment/ale_screen.hpp"
#include "games/RomSettings.hpp"
#include "ale/common/ColourPalette.hpp"
#include "ale/common/Constants.h"
#include "ale/emucore/Console.hxx"
#include "ale/emucore/Props.hxx"
#include "ale/emucore/MD5.hxx"
#include "ale/environment/ale_screen.hpp"
#include "ale/games/RomSettings.hpp"

namespace fs = std::filesystem;

Expand Down
10 changes: 5 additions & 5 deletions src/ale_interface.hpp → src/ale/ale_interface.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@
#ifndef __ALE_INTERFACE_HPP__
#define __ALE_INTERFACE_HPP__

#include "emucore/OSystem.hxx"
#include "games/Roms.hpp"
#include "environment/stella_environment.hpp"
#include "common/ScreenExporter.hpp"
#include "common/Log.hpp"
#include "ale/emucore/OSystem.hxx"
#include "ale/games/Roms.hpp"
#include "ale/environment/stella_environment.hpp"
#include "ale/common/ScreenExporter.hpp"
#include "ale/common/Log.hpp"
#include "version.hpp"

#include <string>
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* Enables conversion from NTSC/SECAM/PAL to RGB via the OSystem's palette.
**************************************************************************** */

#include "common/ColourPalette.hpp"
#include "ale/common/ColourPalette.hpp"

#include <cassert>
#include <cmath>
Expand All @@ -23,7 +23,7 @@
#include <fstream>
#include <iostream>

#include "common/Palettes.hpp"
#include "ale/common/Palettes.hpp"

namespace ale {
namespace {
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/common/Constants.cpp → src/ale/common/Constants.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*
**************************************************************************** */

#include "common/Constants.h"
#include "ale/common/Constants.h"

#include <cassert>
#include <string>
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
*
* Helper functions to manage dynamic loading libraries.
**************************************************************************** */
#include "common/DynamicLoad.hpp"
#include "ale/common/DynamicLoad.hpp"

#if defined(WIN32)
#include <windows.h>
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/common/Log.cpp → src/ale/common/Log.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "common/Log.hpp"
#include "ale/common/Log.hpp"

#include <iostream>

Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/common/SDL2.cpp → src/ale/common/SDL2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* manual definition is more clear.
*/
#ifdef SDL_DYNLOAD
#include "common/SDL2.hpp"
#include "ale/common/SDL2.hpp"

namespace ale {

Expand Down
2 changes: 1 addition & 1 deletion src/common/SDL2.hpp → src/ale/common/SDL2.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
// define some macros to shim the SDL functions
// we use in the ALE.
#ifdef SDL_DYNLOAD
#include "common/DynamicLoad.hpp"
#include "ale/common/DynamicLoad.hpp"

// Try the default dynamic library name per platform
// if SDL2_LIBRARY_NAME is not defined.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*
**************************************************************************** */

#include "common/ScreenExporter.hpp"
#include "ale/common/ScreenExporter.hpp"

#include <zlib.h>
#include <cassert>
Expand All @@ -24,7 +24,7 @@
#include <vector>
#include <iomanip>

#include "common/Log.hpp"
#include "ale/common/Log.hpp"

namespace ale {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@

#include <string>

#include "common/Constants.h"
#include "common/ColourPalette.hpp"
#include "environment/ale_screen.hpp"
#include "ale/common/Constants.h"
#include "ale/common/ColourPalette.hpp"
#include "ale/environment/ale_screen.hpp"

namespace ale {

Expand Down
6 changes: 3 additions & 3 deletions src/common/ScreenSDL.cpp → src/ale/common/ScreenSDL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
* Supports displaying the screen via SDL.
**************************************************************************** */
#ifdef SDL_SUPPORT
#include "common/SDL2.hpp"
#include "ale/common/SDL2.hpp"

#include "common/ScreenSDL.hpp"
#include "common/Log.hpp"
#include "ale/common/ScreenSDL.hpp"
#include "ale/common/Log.hpp"

#include <cmath>

Expand Down
12 changes: 6 additions & 6 deletions src/common/ScreenSDL.hpp → src/ale/common/ScreenSDL.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@

#ifdef SDL_SUPPORT

#include "common/Constants.h"
#include "common/ColourPalette.hpp"
#include "emucore/Screen.hxx"
#include "emucore/OSystem.hxx"
#include "emucore/MediaSrc.hxx"
#include "common/SDL2.hpp"
#include "ale/common/Constants.h"
#include "ale/common/ColourPalette.hpp"
#include "ale/emucore/Screen.hxx"
#include "ale/emucore/OSystem.hxx"
#include "ale/emucore/MediaSrc.hxx"
#include "ale/common/SDL2.hpp"

namespace ale {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "common/SoundExporter.hpp"
#include "ale/common/SoundExporter.hpp"

#include <cassert>

Expand Down
File renamed without changes.
8 changes: 4 additions & 4 deletions src/common/SoundNull.cxx → src/ale/common/SoundNull.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
// $Id: SoundNull.cxx,v 1.6 2007/01/01 18:04:40 stephena Exp $
//============================================================================

#include "emucore/Serializer.hxx"
#include "emucore/Deserializer.hxx"
#include "ale/emucore/Serializer.hxx"
#include "ale/emucore/Deserializer.hxx"


#include "emucore/Settings.hxx"
#include "common/SoundNull.hxx"
#include "ale/emucore/Settings.hxx"
#include "ale/common/SoundNull.hxx"

namespace ale {
using namespace stella; // Settings, Serializer, Deserializer
Expand All @@ -44,7 +44,7 @@
if(in.getString() != soundDevice)
return false;

uint8_t reg;

Check warning on line 47 in src/ale/common/SoundNull.cxx

View workflow job for this annotation

GitHub Actions / macos-12 • x86_64

variable 'reg' set but not used [-Wunused-but-set-variable]

Check warning on line 47 in src/ale/common/SoundNull.cxx

View workflow job for this annotation

GitHub Actions / macos-12 • arm64

variable 'reg' set but not used [-Wunused-but-set-variable]
reg = (uint8_t) in.getInt();
reg = (uint8_t) in.getInt();
reg = (uint8_t) in.getInt();
Expand Down
2 changes: 1 addition & 1 deletion src/common/SoundNull.hxx → src/ale/common/SoundNull.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class Deserializer;
} // namespace stella
} // namespace ale

#include "emucore/Sound.hxx"
#include "ale/emucore/Sound.hxx"

namespace ale {

Expand Down
20 changes: 10 additions & 10 deletions src/common/SoundSDL.cxx → src/ale/common/SoundSDL.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@
#include <cassert>
#include <cmath>

#include "emucore/TIASnd.hxx"
// #include "FrameBuffer.hxx"
#include "emucore/Serializer.hxx"
#include "emucore/Deserializer.hxx"
#include "emucore/Settings.hxx"
#include "emucore/System.hxx"

#include "common/SDL2.hpp"
#include "common/SoundSDL.hxx"
#include "common/Log.hpp"
#include "ale/emucore/TIASnd.hxx"
// #include "ale/FrameBuffer.hxx"
#include "ale/emucore/Serializer.hxx"
#include "ale/emucore/Deserializer.hxx"
#include "ale/emucore/Settings.hxx"
#include "ale/emucore/System.hxx"

#include "ale/common/SDL2.hpp"
#include "ale/common/SoundSDL.hxx"
#include "ale/common/Log.hpp"

namespace ale {
using namespace stella; // Settings, Serializer, Deserializer
Expand Down
10 changes: 5 additions & 5 deletions src/common/SoundSDL.hxx → src/ale/common/SoundSDL.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ class Settings;
} // namespace stella
} // namespace ale

#include "emucore/Sound.hxx"
#include "emucore/MediaSrc.hxx"
#include "emucore/TIASnd.hxx"
#include "ale/emucore/Sound.hxx"
#include "ale/emucore/MediaSrc.hxx"
#include "ale/emucore/TIASnd.hxx"

#include "common/SDL2.hpp"
#include "ale/common/SDL2.hpp"
// If desired, we save sound to disk
#include "common/SoundExporter.hpp"
#include "ale/common/SoundExporter.hpp"
#include <memory>

namespace ale {
Expand Down
File renamed without changes.
52 changes: 26 additions & 26 deletions src/emucore/Cart.cxx → src/ale/emucore/Cart.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -22,32 +22,32 @@
#include <cassert>
#include <sstream>

#include "emucore/Cart.hxx"
#include "emucore/Cart0840.hxx"
#include "emucore/Cart2K.hxx"
#include "emucore/Cart3E.hxx"
#include "emucore/Cart3F.hxx"
#include "emucore/Cart4A50.hxx"
#include "emucore/Cart4K.hxx"
#include "emucore/CartAR.hxx"
#include "emucore/CartDPC.hxx"
#include "emucore/CartE0.hxx"
#include "emucore/CartE7.hxx"
#include "emucore/CartF4.hxx"
#include "emucore/CartF4SC.hxx"
#include "emucore/CartF6.hxx"
#include "emucore/CartF6SC.hxx"
#include "emucore/CartF8.hxx"
#include "emucore/CartF8SC.hxx"
#include "emucore/CartFASC.hxx"
#include "emucore/CartFE.hxx"
#include "emucore/CartMC.hxx"
#include "emucore/CartMB.hxx"
#include "emucore/CartCV.hxx"
#include "emucore/CartUA.hxx"
#include "emucore/MD5.hxx"
#include "emucore/Props.hxx"
#include "emucore/Settings.hxx"
#include "ale/emucore/Cart.hxx"
#include "ale/emucore/Cart0840.hxx"
#include "ale/emucore/Cart2K.hxx"
#include "ale/emucore/Cart3E.hxx"
#include "ale/emucore/Cart3F.hxx"
#include "ale/emucore/Cart4A50.hxx"
#include "ale/emucore/Cart4K.hxx"
#include "ale/emucore/CartAR.hxx"
#include "ale/emucore/CartDPC.hxx"
#include "ale/emucore/CartE0.hxx"
#include "ale/emucore/CartE7.hxx"
#include "ale/emucore/CartF4.hxx"
#include "ale/emucore/CartF4SC.hxx"
#include "ale/emucore/CartF6.hxx"
#include "ale/emucore/CartF6SC.hxx"
#include "ale/emucore/CartF8.hxx"
#include "ale/emucore/CartF8SC.hxx"
#include "ale/emucore/CartFASC.hxx"
#include "ale/emucore/CartFE.hxx"
#include "ale/emucore/CartMC.hxx"
#include "ale/emucore/CartMB.hxx"
#include "ale/emucore/CartCV.hxx"
#include "ale/emucore/CartUA.hxx"
#include "ale/emucore/MD5.hxx"
#include "ale/emucore/Props.hxx"
#include "ale/emucore/Settings.hxx"

namespace ale {
namespace stella {
Expand Down
4 changes: 2 additions & 2 deletions src/emucore/Cart.hxx → src/ale/emucore/Cart.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ class Settings;
} // namespace ale

#include <fstream>
#include "emucore/Device.hxx"
#include "common/Log.hpp"
#include "ale/emucore/Device.hxx"
#include "ale/common/Log.hpp"

namespace ale {
namespace stella {
Expand Down
Loading
Loading